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

Backend

Struct Backend 

Source
pub struct Backend { /* private fields */ }
Expand description

Backend wrapper for Instance operations

This struct wraps a BackendImpl and provides methods for backend operations. Currently it’s a thin wrapper that delegates all calls to the underlying BackendImpl.

In the future, this will be converted to an enum to support both local and remote (RPC-based) backends, allowing for transparent local/remote dispatch.

Implementations§

Source§

impl Backend

Source

pub fn new(backend_impl: Arc<dyn BackendImpl>) -> Self

Create a new Backend wrapping a BackendImpl

Source

pub async fn get(&self, id: &ID) -> Result<Entry>

Get an entry from the backend

Source

pub async fn get_verification_status( &self, id: &ID, ) -> Result<VerificationStatus>

Get verification status of an entry

Source

pub async fn put( &self, verification: VerificationStatus, entry: Entry, ) -> Result<()>

Put an entry into the backend with verification status

Source

pub async fn put_verified(&self, entry: Entry) -> Result<()>

Put a verified entry (convenience method)

Source

pub async fn put_unverified(&self, entry: Entry) -> Result<()>

Put an unverified entry (convenience method)

Source

pub async fn update_verification_status( &self, id: &ID, status: VerificationStatus, ) -> Result<()>

Update verification status of an entry

Source

pub async fn get_entries_by_verification_status( &self, status: VerificationStatus, ) -> Result<Vec<ID>>

Get entries by verification status

Source

pub async fn get_tips(&self, tree: &ID) -> Result<Vec<ID>>

Get tips for a tree

Source

pub async fn get_store_tips(&self, tree: &ID, store: &str) -> Result<Vec<ID>>

Get tips for a specific store within a tree

Source

pub async fn get_store_tips_up_to_entries( &self, tree: &ID, store: &str, up_to: &[ID], ) -> Result<Vec<ID>>

Get store tips up to specific entries

Source

pub async fn all_roots(&self) -> Result<Vec<ID>>

Get all root entries

Source

pub async fn find_merge_base( &self, tree: &ID, store: &str, entry_ids: &[ID], ) -> Result<ID>

Find merge base (common dominator) of entries

Source

pub async fn collect_root_to_target( &self, tree: &ID, store: &str, target: &ID, ) -> Result<Vec<ID>>

Collect root to target path

Source

pub async fn get_tree(&self, tree: &ID) -> Result<Vec<Entry>>

Get all entries in a tree

Source

pub async fn get_store(&self, tree: &ID, store: &str) -> Result<Vec<Entry>>

Get all entries in a store

Source

pub async fn get_tree_from_tips( &self, tree: &ID, tips: &[ID], ) -> Result<Vec<Entry>>

Get tree entries from tips

Source

pub async fn get_store_from_tips( &self, tree: &ID, store: &str, tips: &[ID], ) -> Result<Vec<Entry>>

Get store entries from tips

Source

pub async fn get_cached_crdt_state( &self, entry_id: &ID, store: &str, ) -> Result<Option<String>>

Get cached CRDT state

Source

pub async fn cache_crdt_state( &self, entry_id: &ID, store: &str, state: String, ) -> Result<()>

Cache CRDT state

Source

pub async fn clear_crdt_cache(&self) -> Result<()>

Clear CRDT cache

Source

pub async fn get_sorted_store_parents( &self, tree_id: &ID, entry_id: &ID, store: &str, ) -> Result<Vec<ID>>

Get sorted store parents

Source

pub async fn get_path_from_to( &self, tree_id: &ID, store: &str, from_id: &ID, to_ids: &[ID], ) -> Result<Vec<ID>>

Get path from one entry to others

Source

pub async fn get_instance_metadata(&self) -> Result<Option<InstanceMetadata>>

Get instance metadata

Source

pub async fn set_instance_metadata( &self, metadata: &InstanceMetadata, ) -> Result<()>

Set instance metadata

Source

pub fn as_backend_impl(&self) -> &dyn BackendImpl

Get access to the underlying BackendImpl

This is provided for special operations like downcasting to concrete backend types (e.g., for save/load operations on InMemory). Use with caution.

Source

pub fn as_arc_backend_impl(&self) -> &Arc<dyn BackendImpl>

Get access to the underlying Arc<dyn BackendImpl>

This is needed for validation functions and other code that expects the Arc wrapper. Returns a reference to the Arc.

Source

pub fn as_any(&self) -> &dyn Any

Downcast to Any for concrete backend type access

This is primarily used for downcasting to concrete backend types (e.g., InMemory) for save/load operations or testing.

Trait Implementations§

Source§

impl Clone for Backend

Source§

fn clone(&self) -> Backend

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 Handle for Backend

§

fn handle(&self) -> Self

Creates a new handle to the same underlying resource. 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