LogStore

Trait LogStore 

Source
pub trait LogStore {
    type Value: Codec + Clone;

    // Required methods
    fn is_empty(&self) -> bool;
    fn op_count(&self) -> Location;
    fn inactivity_floor_loc(&self) -> Location;
    fn get_metadata(
        &self,
    ) -> impl Future<Output = Result<Option<Self::Value>, Error>>;
}
Expand description

A trait for any key-value store based on an append-only log of operations.

Required Associated Types§

Required Methods§

Source

fn is_empty(&self) -> bool

Returns true if there are no active keys in the database.

Source

fn op_count(&self) -> Location

The number of operations that have been applied to this db, including those that have been pruned and those that are not yet committed.

Source

fn inactivity_floor_loc(&self) -> Location

Return the inactivity floor location. This is the location before which all operations are known to be inactive. Operations before this point can be safely pruned.

Source

fn get_metadata( &self, ) -> impl Future<Output = Result<Option<Self::Value>, Error>>

Get the metadata associated with the last commit.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<A> LogStore for AnyExt<A>
where A: CleanAny,

Source§

impl<E, K, V, T> LogStore for Store<E, K, V, T>
where E: Storage + Clock + Metrics, K: Array, V: VariableValue, T: Translator,

Source§

type Value = V

Source§

impl<E: RStorage + Clock + Metrics, K: Array, V: FixedValue, H: Hasher, T: Translator, const N: usize, S: State<DigestOf<H>>> LogStore for commonware_storage::qmdb::current::ordered::fixed::Db<E, K, V, H, T, N, S>

Source§

type Value = V

Source§

impl<E: RStorage + Clock + Metrics, K: Array, V: FixedValue, H: Hasher, T: Translator, const N: usize, S: State<DigestOf<H>>> LogStore for commonware_storage::qmdb::current::unordered::fixed::Db<E, K, V, H, T, N, S>

Source§

type Value = V

Source§

impl<E: RStorage + Clock + Metrics, K: Array, V: VariableValue, H: CHasher, T: Translator, S: State<DigestOf<H>>> LogStore for Immutable<E, K, V, H, T, S>

Source§

type Value = V

Source§

impl<E: Storage + Clock + Metrics, V: VariableValue, H: Hasher, S: State<DigestOf<H>>> LogStore for Keyless<E, V, H, S>

Source§

type Value = V