Development Documentation (main branch) - For stable release docs, see docs.rs/eidetica
Skip to main content

RemoteBackend

Struct RemoteBackend 

Source
pub struct RemoteBackend { /* private fields */ }
Expand description

A Backend that translates every storage operation to a wire RPC over a shared RemoteConnection.

The only per-handle state is the acting identity: None means “use the connection’s current session identity” (the instance-level backend), and Some(k) means “act as k” (a Database handle opened with key k). Every clone shares the same socket and session — additional keys are proof-of-possession registered into the connection’s keyset by the handle constructors, not by holding a separate connection.

Tree-scoped methods use the tree argument the caller already supplies (Transaction passes the owning database’s root), so no root is bound here. get derives its gating tree server-side from the fetched entry, so it passes ID::default() as the (waved-through) request root.

Views onto published record sets are server-issued opaque tokens that carry no database of their own, so views remembers which database each token was resolved against and every later record read is routed back to it.

Implementations§

Source§

impl RemoteBackend

Source

pub fn new(conn: RemoteConnection, identity: Option<SigKey>) -> Self

Trait Implementations§

Source§

impl Backend for RemoteBackend

Source§

fn resolve_store_state<'life0, 'life1, 'async_trait>( &'life0 self, request: &'life1 StoreStateRequest, ) -> Pin<Box<dyn Future<Output = Result<Option<RecordView>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn begin_store_state_staging<'life0, 'async_trait>( &'life0 self, request: StoreStateRequest, ) -> Pin<Box<dyn Future<Output = Result<StagingToken>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn stage_store_state_records<'life0, 'life1, 'async_trait>( &'life0 self, token: &'life1 StagingToken, records: RecordMutations, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn publish_store_state<'life0, 'async_trait>( &'life0 self, token: StagingToken, ) -> Pin<Box<dyn Future<Output = Result<RecordView>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn abort_store_state<'life0, 'async_trait>( &'life0 self, token: StagingToken, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn store_state_record_get<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, view: &'life1 RecordView, key: &'life2 [u8], ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source§

fn store_state_record_scan<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, view: &'life1 RecordView, range: &'life2 RecordRange, after: Option<&'life3 [u8]>, limit: usize, ) -> Pin<Box<dyn Future<Output = Result<RecordPage>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Source§

fn clear_derived_store_state<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn get<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 ID, ) -> Pin<Box<dyn Future<Output = Result<Entry>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Retrieve an entry by ID.
Source§

fn snapshot<'life0, 'life1, 'async_trait>( &'life0 self, tree: &'life1 ID, ) -> Pin<Box<dyn Future<Output = Result<Snapshot>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Raw Snapshot of tree (no Verified-frontier filtering — that stays in Database).
Source§

fn store_snapshot<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, tree: &'life1 ID, store: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<Snapshot>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Raw Snapshot of store within tree.
Source§

fn store_snapshot_at<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, tree: &'life1 ID, store: &'life2 str, main_snapshot: &'life3 Snapshot, ) -> Pin<Box<dyn Future<Output = Result<Snapshot>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Store snapshot reachable as of a specific main-tree snapshot.
Source§

fn store_at<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, tree: &'life1 ID, store: &'life2 str, snapshot: &'life3 Snapshot, ) -> Pin<Box<dyn Future<Output = Result<Vec<Entry>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Every entry of store reachable from snapshot.
Source§

fn compute_merge_state<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, tree: &'life1 ID, store: &'life2 str, entry_ids: &'life3 [ID], ) -> Pin<Box<dyn Future<Output = Result<MergeSlice>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

The merge base of entry_ids within store and the path of entries from that base to them, resolved together. Read more
Source§

fn put<'life0, 'async_trait>( &'life0 self, entry: Entry, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Persist an entry. Local stores it directly; remote submits it via DatabaseOp::SubmitSignedEntry (stored Unverified, server-verified).
Source§

fn write_entry<'life0, 'async_trait>( &'life0 self, _verification: VerificationStatus, entry: Entry, _source: WriteSource, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Durably persist a signed entry, applying verification locally or submitting it over the wire. source informs local callback dispatch (handled by Instance::put_entry) and is unused on remote.
Source§

fn get_instance_metadata<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Option<InstanceMetadata>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Public instance metadata (device identity, system database IDs).
Source§

fn set_instance_metadata<'life0, 'life1, 'async_trait>( &'life0 self, metadata: &'life1 InstanceMetadata, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Persist public instance metadata.
Source§

fn remote_connection(&self) -> Option<RemoteConnection>

The remote connection, if this is a remote backend. Returns None for local backends.
Source§

fn local_engine(&self) -> Option<Arc<dyn BackendImpl>>

The concrete in-process storage engine, if this is a local backend. Read more
Source§

impl Clone for RemoteBackend

Source§

fn clone(&self) -> RemoteBackend

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RemoteBackend

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FromRef<T> for T
where T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,