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
impl RemoteBackend
pub fn new(conn: RemoteConnection, identity: Option<SigKey>) -> Self
Trait Implementations§
Source§impl Backend for RemoteBackend
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
(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,
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,
(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,
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,
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,
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,
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,
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,
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,
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,
Source§fn remote_connection(&self) -> Option<RemoteConnection>
fn remote_connection(&self) -> Option<RemoteConnection>
None for
local backends.Source§fn local_engine(&self) -> Option<Arc<dyn BackendImpl>>
fn local_engine(&self) -> Option<Arc<dyn BackendImpl>>
Source§impl Clone for RemoteBackend
impl Clone for RemoteBackend
Source§fn clone(&self) -> RemoteBackend
fn clone(&self) -> RemoteBackend
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for RemoteBackend
impl !RefUnwindSafe for RemoteBackend
impl Send for RemoteBackend
impl Sync for RemoteBackend
impl Unpin for RemoteBackend
impl UnsafeUnpin for RemoteBackend
impl !UnwindSafe for RemoteBackend
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> CompatExt for T
impl<T> CompatExt for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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