pub trait BackendImpl:
Send
+ Sync
+ Any {
Show 25 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 get_verification_status<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 ID,
) -> Pin<Box<dyn Future<Output = Result<VerificationStatus>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn put<'life0, 'async_trait>(
&'life0 self,
verification_status: VerificationStatus,
entry: Entry,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn update_verification_status<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 ID,
verification_status: VerificationStatus,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_entries_by_verification_status<'life0, 'async_trait>(
&'life0 self,
status: VerificationStatus,
) -> Pin<Box<dyn Future<Output = Result<Vec<ID>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_tips<'life0, 'life1, 'async_trait>(
&'life0 self,
tree: &'life1 ID,
) -> Pin<Box<dyn Future<Output = Result<Vec<ID>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_store_tips<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
tree: &'life1 ID,
store: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<ID>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn get_store_tips_up_to_entries<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
tree: &'life1 ID,
store: &'life2 str,
main_entries: &'life3 [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;
fn all_roots<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<ID>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: '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;
fn collect_root_to_target<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
tree: &'life1 ID,
store: &'life2 str,
target_entry: &'life3 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;
fn as_any(&self) -> &dyn Any;
fn get_tree<'life0, 'life1, 'async_trait>(
&'life0 self,
tree: &'life1 ID,
) -> Pin<Box<dyn Future<Output = Result<Vec<Entry>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_store<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
tree: &'life1 ID,
store: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<Entry>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn get_tree_from_tips<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
tree: &'life1 ID,
tips: &'life2 [ID],
) -> Pin<Box<dyn Future<Output = Result<Vec<Entry>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn get_store_from_tips<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
tree: &'life1 ID,
store: &'life2 str,
tips: &'life3 [ID],
) -> 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 get_cached_crdt_state<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
entry_id: &'life1 ID,
store: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Option<String>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn cache_crdt_state<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
entry_id: &'life1 ID,
store: &'life2 str,
state: String,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn clear_crdt_cache<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_sorted_store_parents<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
tree_id: &'life1 ID,
entry_id: &'life2 ID,
store: &'life3 str,
) -> 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;
fn get_path_from_to<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
tree_id: &'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_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 put_verified<'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_unverified<'life0, 'async_trait>(
&'life0 self,
entry: Entry,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
}Expand description
BackendImpl trait abstracting the underlying storage mechanism for Eidetica entries.
This trait defines the essential operations required for storing, retrieving, and querying entries and their relationships within databases and stores. Implementations of this trait handle the specifics of how data is persisted (e.g., in memory, on disk, in a remote database).
Much of the performance-critical logic, particularly concerning tree traversal
and tip calculation, resides within BackendImpl implementations, as the optimal
approach often depends heavily on the underlying storage characteristics.
All backend implementations must be Send and Sync to allow sharing across threads,
and implement Any to allow for downcasting if needed.
Instance wraps BackendImpl in a Backend struct that provides additional coordination
and will enable future development.
§Verification Status
The backend stores a verification status for each entry, indicating whether the entry has been authenticated by the higher-level authentication system. The backend itself does not perform verification - it only stores the status set by the calling code (typically Database/Transaction implementations).
Required Methods§
Sourcefn 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,
Sourcefn get_verification_status<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 ID,
) -> Pin<Box<dyn Future<Output = Result<VerificationStatus>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_verification_status<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 ID,
) -> Pin<Box<dyn Future<Output = Result<VerificationStatus>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Sourcefn put<'life0, 'async_trait>(
&'life0 self,
verification_status: VerificationStatus,
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,
verification_status: VerificationStatus,
entry: Entry,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Stores an entry in the database with the specified verification status.
If an entry with the same ID already exists, it may be overwritten, although the content-addressable nature means the content will be identical. The verification status will be updated to the provided value.
§Arguments
verification_status- The verification status to assign to this entryentry- TheEntryto store.
§Returns
A Result indicating success or an error during storage.
Sourcefn update_verification_status<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 ID,
verification_status: VerificationStatus,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn update_verification_status<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 ID,
verification_status: VerificationStatus,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Updates the verification status of an existing entry.
This allows the authentication system to mark entries as verified or failed after they have been stored. Useful for batch verification operations.
§Arguments
id- The ID of the entry to updateverification_status- The new verification status
§Returns
A Result indicating success or Error::NotFound if the entry doesn’t exist.
Sourcefn get_entries_by_verification_status<'life0, 'async_trait>(
&'life0 self,
status: VerificationStatus,
) -> Pin<Box<dyn Future<Output = Result<Vec<ID>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_entries_by_verification_status<'life0, 'async_trait>(
&'life0 self,
status: VerificationStatus,
) -> Pin<Box<dyn Future<Output = Result<Vec<ID>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sourcefn get_tips<'life0, 'life1, 'async_trait>(
&'life0 self,
tree: &'life1 ID,
) -> Pin<Box<dyn Future<Output = Result<Vec<ID>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_tips<'life0, 'life1, 'async_trait>(
&'life0 self,
tree: &'life1 ID,
) -> Pin<Box<dyn Future<Output = Result<Vec<ID>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Retrieves the IDs of the tip entries for a given tree.
Tips are defined as the set of entries within the specified tree
that have no children within that same tree. An entry is considered
a child of another if it lists the other entry in its parents list.
§Arguments
tree- The root ID of the tree for which to find tips.
§Returns
A Result containing a vector of tip entry IDs or an error.
Sourcefn get_store_tips<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
tree: &'life1 ID,
store: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<ID>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_store_tips<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
tree: &'life1 ID,
store: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<ID>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Retrieves the IDs of the tip entries for a specific store within a given tree.
Store tips are defined as the set of entries within the specified store
that have no children within that same store. An entry is considered
a child of another within a store if it lists the other entry in its
store_parents list for that specific store name.
§Arguments
tree- The root ID of the parent tree.store- The name of the store for which to find tips.
§Returns
A Result containing a vector of tip entry IDs for the store or an error.
Sourcefn get_store_tips_up_to_entries<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
tree: &'life1 ID,
store: &'life2 str,
main_entries: &'life3 [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,
fn get_store_tips_up_to_entries<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
tree: &'life1 ID,
store: &'life2 str,
main_entries: &'life3 [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,
Gets the store tips that exist up to a specific set of main tree entries.
This method finds all store entries that are reachable from the specified main tree entries, then filters to find which of those are tips within the store.
§Arguments
tree- The root ID of the parent tree.store- The name of the store for which to find tips.main_entries- The main tree entry IDs to use as the boundary.
§Returns
A Result containing a vector of store tip entry IDs up to the main entries.
Sourcefn all_roots<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<ID>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn all_roots<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<ID>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Retrieves the IDs of all top-level root entries stored in the backend.
Top-level roots are entries that are themselves roots of a tree
(i.e., entry.is_root() is true) and are not part of a larger tree structure
tracked by the backend (conceptually, their tree.root field is empty or refers to themselves,
though the implementation detail might vary). These represent the starting points
of distinct trees managed by the database.
§Returns
A Result containing a vector of top-level root entry IDs or an error.
Sourcefn 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,
Finds the merge base (common dominator) of the given entry IDs within a store.
The merge base is the lowest ancestor that ALL paths from ALL entries must pass through. This is different from the traditional LCA - if there are parallel paths that bypass a common ancestor, that ancestor is not the merge base. This is used to determine optimal computation boundaries for CRDT state calculation.
§Arguments
tree- The root ID of the treestore- The name of the store contextentry_ids- The entry IDs to find the merge base for
§Returns
A Result containing the merge base entry ID, or an error if no common ancestor exists
Sourcefn collect_root_to_target<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
tree: &'life1 ID,
store: &'life2 str,
target_entry: &'life3 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,
fn collect_root_to_target<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
tree: &'life1 ID,
store: &'life2 str,
target_entry: &'life3 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,
Collects all entries from the tree root down to the target entry within a store.
This method performs a complete traversal from the tree root to the target entry, collecting all entries that are ancestors of the target within the specified store. The result includes the tree root and the target entry itself.
§Arguments
tree- The root ID of the treestore- The name of the store contexttarget_entry- The target entry to collect ancestors for
§Returns
A Result containing a vector of entry IDs from root to target, sorted by height
Sourcefn as_any(&self) -> &dyn Any
fn as_any(&self) -> &dyn Any
Returns a reference to the backend instance as a dynamic Any type.
This allows for downcasting to a concrete backend implementation if necessary, enabling access to implementation-specific methods. Use with caution.
Sourcefn get_tree<'life0, 'life1, 'async_trait>(
&'life0 self,
tree: &'life1 ID,
) -> Pin<Box<dyn Future<Output = Result<Vec<Entry>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_tree<'life0, 'life1, 'async_trait>(
&'life0 self,
tree: &'life1 ID,
) -> Pin<Box<dyn Future<Output = Result<Vec<Entry>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Retrieves all entries belonging to a specific tree, sorted topologically.
The entries are sorted primarily by their height (distance from the root) and secondarily by their ID to ensure a consistent, deterministic order suitable for reconstructing the tree’s history.
Note: This potentially loads the entire history of the tree. Use cautiously, especially with large trees, as it can be memory-intensive.
§Arguments
tree- The root ID of the tree to retrieve.
§Returns
A Result containing a vector of all Entry objects in the tree,
sorted topologically, or an error.
Sourcefn get_store<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
tree: &'life1 ID,
store: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<Entry>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_store<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
tree: &'life1 ID,
store: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<Entry>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Retrieves all entries belonging to a specific store within a tree, sorted topologically.
Similar to get_tree, but limited to entries that are part of the specified store.
The entries are sorted primarily by their height within the store (distance
from the store’s initial entry/entries) and secondarily by their ID.
Note: This potentially loads the entire history of the store. Use with caution.
§Arguments
tree- The root ID of the parent tree.store- The name of the store to retrieve.
§Returns
A Result containing a vector of all Entry objects in the store,
sorted topologically according to their position within the store, or an error.
Sourcefn get_tree_from_tips<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
tree: &'life1 ID,
tips: &'life2 [ID],
) -> Pin<Box<dyn Future<Output = Result<Vec<Entry>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_tree_from_tips<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
tree: &'life1 ID,
tips: &'life2 [ID],
) -> Pin<Box<dyn Future<Output = Result<Vec<Entry>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Retrieves all entries belonging to a specific tree up to the given tips, sorted topologically.
Similar to get_tree, but only includes entries that are ancestors of the provided tips.
This allows reading from a specific state of the tree defined by those tips.
§Arguments
tree- The root ID of the tree to retrieve.tips- The tip IDs defining the state to read from.
§Returns
A Result containing a vector of Entry objects in the tree up to the given tips,
sorted topologically, or an error.
§Errors
EntryNotFoundif any tip doesn’t exist locallyEntryNotInTreeif any tip belongs to a different tree
Sourcefn get_store_from_tips<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
tree: &'life1 ID,
store: &'life2 str,
tips: &'life3 [ID],
) -> 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 get_store_from_tips<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
tree: &'life1 ID,
store: &'life2 str,
tips: &'life3 [ID],
) -> 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,
Retrieves all entries belonging to a specific store within a tree up to the given tips, sorted topologically.
Similar to get_subtree, but only includes entries that are ancestors of the provided store tips.
This allows reading from a specific state of the store defined by those tips.
§Arguments
tree- The root ID of the parent tree.store- The name of the store to retrieve.tips- The tip IDs defining the state to read from.
§Returns
A Result containing a vector of Entry objects in the store up to the given tips,
sorted topologically, or an error.
Sourcefn get_cached_crdt_state<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
entry_id: &'life1 ID,
store: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Option<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_cached_crdt_state<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
entry_id: &'life1 ID,
store: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Option<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Sourcefn cache_crdt_state<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
entry_id: &'life1 ID,
store: &'life2 str,
state: String,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn cache_crdt_state<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
entry_id: &'life1 ID,
store: &'life2 str,
state: String,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Sourcefn clear_crdt_cache<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn clear_crdt_cache<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Clear all cached CRDT states.
This is used when the CRDT computation algorithm changes and existing cached states may have been computed incorrectly.
§Returns
A Result indicating success or an error during the clear operation.
Sourcefn get_sorted_store_parents<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
tree_id: &'life1 ID,
entry_id: &'life2 ID,
store: &'life3 str,
) -> 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,
fn get_sorted_store_parents<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
tree_id: &'life1 ID,
entry_id: &'life2 ID,
store: &'life3 str,
) -> 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,
Get the store parent IDs for a specific entry and store, sorted by height then ID.
This method retrieves the parent entry IDs for a given entry in a specific store context, sorted using the same deterministic ordering used throughout the system (height ascending, then ID ascending for ties).
§Arguments
tree_id- The ID of the tree containing the entryentry_id- The ID of the entry to get parents forstore- The name of the store context
§Returns
A Result containing a Vec<ID> of parent entry IDs sorted by (height, ID).
Returns empty vec if the entry has no parents in the store.
Sourcefn get_path_from_to<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
tree_id: &'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_id: &'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,
Gets all entries between one entry and multiple target entries (exclusive of start, inclusive of targets).
This function correctly handles diamond patterns by finding ALL entries that are reachable from any of the to_ids by following parents back to from_id, not just single paths. The results are deduplicated and sorted by height then ID for deterministic CRDT merge ordering.
§Arguments
tree_id- The ID of the tree containing the entriesstore- The name of the store contextfrom_id- The starting entry ID (not included in result)to_ids- The target entry IDs (all included in result)
§Returns
A Result<Vec<ID>> containing all entry IDs between from and any of the targets, deduplicated and sorted by height then ID
Sourcefn 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,
Get the instance metadata.
Returns None for a fresh/uninitialized backend, Some(metadata) for an
initialized instance. This is used during Instance::open() to determine
whether to create a new instance or load an existing one.
§Returns
A Result containing Option<InstanceMetadata>:
Some(metadata)if the instance has been initializedNoneif the backend is fresh/uninitialized
Sourcefn 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,
Set the instance metadata.
This is called during instance creation to persist the device key and
system database IDs. It may also be called when enabling sync to update
the sync_db field.
§Arguments
metadata- The instance metadata to persist
§Returns
A Result indicating success or an error during storage.
Provided Methods§
Sourcefn put_verified<'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_verified<'life0, 'async_trait>(
&'life0 self,
entry: Entry,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Stores an entry with verified status (convenience method for local entries).
This is a convenience method that calls put(VerificationStatus::Verified, entry).
Use this for locally created and signed entries.
§Arguments
entry- TheEntryto store as verified.
§Returns
A Result indicating success or an error during storage.
Sourcefn put_unverified<'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_unverified<'life0, 'async_trait>(
&'life0 self,
entry: Entry,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Stores an entry with failed verification status (convenience method for sync scenarios).
This is a convenience method that calls put(VerificationStatus::Failed, entry).
Use this for entries that failed verification or are pending verification from sync.
In the future, this may use a dedicated Unverified status.
§Arguments
entry- TheEntryto store as failed/unverified.
§Returns
A Result indicating success or an error during storage.