pub struct RemoteConnection { /* private fields */ }Expand description
A connection to a remote Eidetica service server over a Unix domain socket.
RemoteConnection backs the RemoteBackend implementation of the Backend
seam. It provides the storage operations as inherent methods, plus additional
coordination methods like notify_entry_written.
Cloning is cheap (Arc-backed).
Implementations§
Source§impl RemoteConnection
impl RemoteConnection
Sourcepub async fn connect(path: impl AsRef<Path>) -> Result<Self>
pub async fn connect(path: impl AsRef<Path>) -> Result<Self>
Connect to a service server at the given socket path.
Performs the protocol handshake and returns a connection ready for use.
Sourcepub fn session_identity(&self) -> Option<SigKey>
pub fn session_identity(&self) -> Option<SigKey>
Build a SigKey from the session pubkey, when logged in.
pub async fn get_instance_metadata(&self) -> Result<Option<InstanceMetadata>>
pub async fn set_instance_metadata( &self, metadata: &InstanceMetadata, ) -> Result<()>
Sourcepub async fn begin_transaction(
&self,
root_id: ID,
identity: SigKey,
stores: Vec<String>,
scope: ReadScope,
) -> Result<TransactionContext>
pub async fn begin_transaction( &self, root_id: ID, identity: SigKey, stores: Vec<String>, scope: ReadScope, ) -> Result<TransactionContext>
Acquire a TransactionContext for the given stores and scope.
The returned context includes main-tree parents with heights,
per-store subtree parents, _settings tips, and the merged
_settings value — everything needed to build and sign an entry
locally without further round-trips.
Sourcepub async fn get_store_state(
&self,
root_id: ID,
identity: SigKey,
store: String,
) -> Result<WireCrdtValue>
pub async fn get_store_state( &self, root_id: ID, identity: SigKey, store: String, ) -> Result<WireCrdtValue>
Fetch the server-materialized merged state of an unencrypted store.
Sourcepub async fn get_store_entries(
&self,
root_id: ID,
identity: SigKey,
store: String,
tips: Vec<ID>,
scope: ReadScope,
) -> Result<Vec<Entry>>
pub async fn get_store_entries( &self, root_id: ID, identity: SigKey, store: String, tips: Vec<ID>, scope: ReadScope, ) -> Result<Vec<Entry>>
Fetch ordered, verified, opaque store entries reachable from tips.
Universal primitive — works for encrypted stores (client decrypts locally) as well as unencrypted ones.
Sourcepub async fn get_verified_tips(
&self,
root_id: ID,
identity: SigKey,
) -> Result<Vec<ID>>
pub async fn get_verified_tips( &self, root_id: ID, identity: SigKey, ) -> Result<Vec<ID>>
Fetch the database’s Verified-frontier tips.
Sourcepub async fn submit_signed_entry(
&self,
root_id: ID,
identity: SigKey,
entry: Entry,
) -> Result<()>
pub async fn submit_signed_entry( &self, root_id: ID, identity: SigKey, entry: Entry, ) -> Result<()>
Submit a client-signed entry to the server.
The server stores the entry as Unverified and runs its own
verification pass — it never trusts a submitted entry’s claimed
validity.
Sourcepub async fn db_get_entry(
&self,
root_id: ID,
identity: SigKey,
id: ID,
) -> Result<Entry>
pub async fn db_get_entry( &self, root_id: ID, identity: SigKey, id: ID, ) -> Result<Entry>
Fetch a single database entry by id.
Gated post-fetch by the entry’s owning tree, so the caller must hold
at least Read on the database the entry belongs to.
Sourcepub async fn store_snapshot_at(
&self,
root_id: ID,
identity: SigKey,
store: String,
up_to: Vec<ID>,
) -> Result<Vec<ID>>
pub async fn store_snapshot_at( &self, root_id: ID, identity: SigKey, store: String, up_to: Vec<ID>, ) -> Result<Vec<ID>>
Subtree tips reachable from given main-tree entries.
Sourcepub async fn compute_merge_state(
&self,
root_id: ID,
identity: SigKey,
store: String,
entry_ids: Vec<ID>,
) -> Result<MergeState>
pub async fn compute_merge_state( &self, root_id: ID, identity: SigKey, store: String, entry_ids: Vec<ID>, ) -> Result<MergeState>
Compute merge state: lowest common ancestor + path to tip entries.
Sourcepub async fn get_cached_crdt_state_remote(
&self,
root_id: ID,
identity: SigKey,
store: String,
key: ID,
) -> Result<Option<Vec<u8>>>
pub async fn get_cached_crdt_state_remote( &self, root_id: ID, identity: SigKey, store: String, key: ID, ) -> Result<Option<Vec<u8>>>
Tier 2 cache read: ask the daemon for a previously-stashed CRDT
state blob. None on miss; the caller falls back to a full
recompute from store entries.
Sourcepub async fn cache_crdt_state_remote(
&self,
root_id: ID,
identity: SigKey,
store: String,
key: ID,
blob: Vec<u8>,
) -> Result<()>
pub async fn cache_crdt_state_remote( &self, root_id: ID, identity: SigKey, store: String, key: ID, blob: Vec<u8>, ) -> Result<()>
Tier 2 cache write: stash a client-computed CRDT state blob in the
daemon’s unified cache, scoped to the session user
(crate::backend::CacheScope::User). Per-user trust; the daemon
stores opaque bytes verbatim.
Trait Implementations§
Source§impl Clone for RemoteConnection
impl Clone for RemoteConnection
Source§fn clone(&self) -> RemoteConnection
fn clone(&self) -> RemoteConnection
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 RemoteConnection
impl !RefUnwindSafe for RemoteConnection
impl Send for RemoteConnection
impl Sync for RemoteConnection
impl Unpin for RemoteConnection
impl UnsafeUnpin for RemoteConnection
impl !UnwindSafe for RemoteConnection
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