CleanAny

Trait CleanAny 

Source
pub trait CleanAny: CleanStore<Dirty: DirtyAny<Key = Self::Key, Value = Self::Value, Clean = Self>> {
    type Key: Array;

    // Required methods
    fn get(
        &self,
        key: &Self::Key,
    ) -> impl Future<Output = Result<Option<Self::Value>, Error>>;
    fn commit(
        &mut self,
        metadata: Option<Self::Value>,
    ) -> impl Future<Output = Result<Range<Location>, Error>>;
    fn sync(&mut self) -> impl Future<Output = Result<(), Error>>;
    fn prune(
        &mut self,
        prune_loc: Location,
    ) -> impl Future<Output = Result<(), Error>>;
    fn close(self) -> impl Future<Output = Result<(), Error>>;
    fn destroy(self) -> impl Future<Output = Result<(), Error>>;
}
Expand description

Extension trait for “Any” QMDBs in a clean (merkleized) state.

Required Associated Types§

Source

type Key: Array

The key type for this database.

Required Methods§

Source

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

Get the value for a given key, or None if it has no value.

Source

fn commit( &mut self, metadata: Option<Self::Value>, ) -> impl Future<Output = Result<Range<Location>, Error>>

Commit pending operations to the database, ensuring durability. Returns the location range of committed operations.

Source

fn sync(&mut self) -> impl Future<Output = Result<(), Error>>

Sync all database state to disk.

Source

fn prune( &mut self, prune_loc: Location, ) -> impl Future<Output = Result<(), Error>>

Prune historical operations prior to prune_loc.

Source

fn close(self) -> impl Future<Output = Result<(), Error>>

Close the db. Uncommitted operations will be lost or rolled back on restart.

Source

fn destroy(self) -> impl Future<Output = Result<(), Error>>

Destroy the db, removing all data from disk.

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<E: RStorage + Clock + Metrics, K: Array, V: FixedValue, H: Hasher, T: Translator, const N: usize> CleanAny for commonware_storage::qmdb::current::ordered::fixed::Db<E, K, V, H, T, N, Clean<DigestOf<H>>>

Source§

type Key = K

Source§

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

Source§

type Key = K