MonotreeStorageAdapter

Trait MonotreeStorageAdapter 

Source
pub trait MonotreeStorageAdapter {
    // Required methods
    fn put(&mut self, key: &Hash, value: Vec<u8>) -> GenericResult<()>;
    fn get(&self, key: &[u8]) -> GenericResult<Option<Vec<u8>>>;
    fn del(&mut self, key: &Hash) -> GenericResult<()>;
    fn init_batch(&mut self) -> GenericResult<()>;
    fn finish_batch(&mut self) -> GenericResult<()>;
}
Expand description

Trait for implementing Monotree’s storage system

Required Methods§

Source

fn put(&mut self, key: &Hash, value: Vec<u8>) -> GenericResult<()>

Insert a Key/Value pair into the Monotree

Source

fn get(&self, key: &[u8]) -> GenericResult<Option<Vec<u8>>>

Query the Monotree for a Key

Source

fn del(&mut self, key: &Hash) -> GenericResult<()>

Delete an entry in the Monotree

Source

fn init_batch(&mut self) -> GenericResult<()>

Initialize a batch

Source

fn finish_batch(&mut self) -> GenericResult<()>

Finalize and write a batch

Implementors§