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§
Sourcefn put(&mut self, key: &Hash, value: Vec<u8>) -> GenericResult<()>
fn put(&mut self, key: &Hash, value: Vec<u8>) -> GenericResult<()>
Insert a Key/Value pair into the Monotree
Sourcefn del(&mut self, key: &Hash) -> GenericResult<()>
fn del(&mut self, key: &Hash) -> GenericResult<()>
Delete an entry in the Monotree
Sourcefn init_batch(&mut self) -> GenericResult<()>
fn init_batch(&mut self) -> GenericResult<()>
Initialize a batch
Sourcefn finish_batch(&mut self) -> GenericResult<()>
fn finish_batch(&mut self) -> GenericResult<()>
Finalize and write a batch