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.

CRDT-state caching is two-tiered: a connection-scoped process-lifetime LRU (tier 1) backed by the daemon’s unified scope-keyed cache (tier 2) reached via GetCachedCrdtState / CacheCrdtState RPCs.

Implementations§

Source§

impl RemoteBackend

Source

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

Trait Implementations§

Source§

impl Backend for RemoteBackend

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 find_merge_base<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, tree: &'life1 ID, store: &'life2 str, entry_ids: &'life3 [ID], ) -> Pin<Box<dyn Future<Output = Result<ID>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Lowest common ancestor of entry_ids within store.
Source§

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

Every entry on the path from from_id to each of to_ids within store.
Source§

fn get_cached_crdt_state<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, tree: &'life1 ID, entry_id: &'life2 ID, store: &'life3 str, ) -> 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, 'life3: 'async_trait,

Cached materialized CRDT state for (entry_id, store) within tree, if present. tree keys the daemon-side cache and gates the wire RPC; the local engine ignores it (it serves the trusted shared scope).
Source§

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

Cache materialized CRDT state for (entry_id, store) within tree.
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 · 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
§

impl<T> CompatExt for T

§

fn compat(self) -> Compat<T>

Applies the [Compat] adapter by value. Read more
§

fn compat_ref(&self) -> Compat<&T>

Applies the [Compat] adapter by shared reference. Read more
§

fn compat_mut(&mut self) -> Compat<&mut T>

Applies the [Compat] adapter by mutable reference. Read more
Source§

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

Source§

fn __clone_box(&self, _: Private) -> *mut ()

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