pub trait Database {
// Required methods
fn new(dbpath: &str) -> Self;
fn get(&mut self, key: &[u8]) -> Result<Option<Vec<u8>>>;
fn put(&mut self, key: &[u8], value: Vec<u8>) -> Result<()>;
fn delete(&mut self, key: &[u8]) -> Result<()>;
fn init_batch(&mut self) -> Result<()>;
fn finish_batch(&mut self) -> Result<()>;
}Expand description
A trait defining databases used for monotree.
Required Methods§
fn new(dbpath: &str) -> Self
fn get(&mut self, key: &[u8]) -> Result<Option<Vec<u8>>>
fn put(&mut self, key: &[u8], value: Vec<u8>) -> Result<()>
fn delete(&mut self, key: &[u8]) -> Result<()>
fn init_batch(&mut self) -> Result<()>
fn finish_batch(&mut self) -> Result<()>
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.