pub struct MemDb(/* private fields */);Expand description
This implements Database as an in-memory hash map. commit is not atomic.
Implementations§
Trait Implementations§
Source§impl<H> Database<H> for MemDb
 
impl<H> Database<H> for MemDb
Source§fn commit(&self, transaction: Transaction<H>) -> Result<()>
 
fn commit(&self, transaction: Transaction<H>) -> Result<()>
Commit the 
transaction to the database atomically. Any further calls to get or lookup
will reflect the new state.Source§fn get(&self, col: ColumnId, key: &[u8]) -> Option<Vec<u8>>
 
fn get(&self, col: ColumnId, key: &[u8]) -> Option<Vec<u8>>
Retrieve the value previously stored against 
key or None if
key is not currently in the database.Source§fn contains(&self, col: ColumnId, key: &[u8]) -> bool
 
fn contains(&self, col: ColumnId, key: &[u8]) -> bool
Check if the value exists in the database without retrieving it.
Source§fn value_size(&self, col: ColumnId, key: &[u8]) -> Option<usize>
 
fn value_size(&self, col: ColumnId, key: &[u8]) -> Option<usize>
Check value size in the database possibly without retrieving it.
Source§fn supports_ref_counting(&self) -> bool
 
fn supports_ref_counting(&self) -> bool
Check if database supports internal ref counting for state data. Read more
Auto Trait Implementations§
impl !Freeze for MemDb
impl !RefUnwindSafe for MemDb
impl Send for MemDb
impl Sync for MemDb
impl Unpin for MemDb
impl UnwindSafe for MemDb
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
    T: ?Sized,
 
impl<T> BorrowMut<T> for Twhere
    T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
 
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more