Storage

Trait Storage 

Source
pub trait Storage<D: Digest>: Send + Sync {
    // Required methods
    fn size(&self) -> u64;
    fn get_node(
        &self,
        position: u64,
    ) -> impl Future<Output = Result<Option<D>, Error>> + Send;
}
Expand description

A trait for accessing MMR digests from storage.

Required Methods§

Source

fn size(&self) -> u64

Return the number of elements in the MMR.

Source

fn get_node( &self, position: u64, ) -> impl Future<Output = Result<Option<D>, Error>> + Send

Return the specified node of the MMR if it exists & hasn’t been pruned.

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<D: Digest> Storage<D> for ProofStore<D>

Source§

impl<E: RStorage + Clock + Metrics, H: CHasher> Storage<<H as Hasher>::Digest> for commonware_storage::mmr::journaled::Mmr<E, H>

Source§

impl<H> Storage<<H as Hasher>::Digest> for commonware_storage::mmr::mem::Mmr<H>
where H: CHasher,

Source§

impl<H: CHasher, S1: Storage<H::Digest>, S2: Storage<H::Digest>> Storage<<H as Hasher>::Digest> for Grafting<'_, H, S1, S2>

Source§

impl<H: CHasher, const N: usize> Storage<<H as Hasher>::Digest> for Bitmap<H, N>