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

Backend

Trait Backend 

Source
pub trait Backend:
    Send
    + Sync
    + Debug {
Show 20 methods // Required methods 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 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 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_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_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 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; 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 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 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 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; // Provided methods 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 { ... } 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 { ... } 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 { ... } 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 { ... } 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 { ... } 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 { ... } 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 { ... } 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 { ... } fn local_engine(&self) -> Option<Arc<dyn BackendImpl>> { ... } fn remote_connection(&self) -> Option<RemoteConnection> { ... }
}
Expand description

Storage operations shared by transactions, Stores, databases, and instances, whether storage is local or served by a daemon.

Tree-scoped methods take the tree explicitly; the remote implementation uses the argument directly (callers already pass the owning database’s root), so no per-handle root needs to be bound. The only per-handle state a remote backend carries is its acting identity (see RemoteBackend).

Required Methods§

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.

Base and path are one query on purpose: resolving them in separate calls lets the answers come from two different views of the store — on a remote backend, two RPCs a sync ingest can land between — and a path anchored at a base the caller never saw folds into a silently truncated state.

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.

Provided Methods§

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 local_engine(&self) -> Option<Arc<dyn BackendImpl>>

The concrete in-process storage engine, if this is a local backend.

Off-seam local-only operations (instance secrets, verification-status mutation, and all_roots/get_tree raw dumps) are reached through this accessor, so they are usable only where a concrete local backend exists. Returns None for remote backends.

Source

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

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

Implementors§