Trait merkle_log::Store[][src]

pub trait Store {
#[must_use]    fn get<'life0, 'life1, 'async_trait>(
        &'life0 self,
        id: &'life1 TreeID
    ) -> Pin<Box<dyn Future<Output = Result<Node, Error>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
;
#[must_use] fn set<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        id: TreeID,
        node: &'life1 Node
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
; }

Represents access to immutable merkle tree nodes.

Required methods

#[must_use]fn get<'life0, 'life1, 'async_trait>(
    &'life0 self,
    id: &'life1 TreeID
) -> Pin<Box<dyn Future<Output = Result<Node, Error>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

Gets an intermediate Node by its TreeID.

#[must_use]fn set<'life0, 'life1, 'async_trait>(
    &'life0 mut self,
    id: TreeID,
    node: &'life1 Node
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

Stores an intermediate Node by its TreeID.

Loading content...

Implementations on Foreign Types

impl Store for HashMap<TreeID, Node>[src]

fn get<'life0, 'life1, 'async_trait>(
    &'life0 self,
    id: &'life1 TreeID
) -> Pin<Box<dyn Future<Output = Result<Node, Error>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

Delegates to HashMap::get.

Panics

Panics if there is no Node stored at the given depth and offset.

fn set<'life0, 'life1, 'async_trait>(
    &'life0 mut self,
    id: TreeID,
    node: &'life1 Node
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

Delegates to HashMap::insert.

Loading content...

Implementors

impl Store for MemoryStore[src]

fn get<'life0, 'life1, 'async_trait>(
    &'life0 self,
    id: &'life1 TreeID
) -> Pin<Box<dyn Future<Output = Result<Node, Error>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

Delegates to BTreeMap::get.

Panics

Panics if there is no Node stored at the given depth and offset.

fn set<'life0, 'life1, 'async_trait>(
    &'life0 mut self,
    id: TreeID,
    node: &'life1 Node
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

Delegates to BTreeMap::insert.

Loading content...