Struct kvdb_memorydb::InMemory [−][src]
pub struct InMemory { /* fields omitted */ }
A key-value database fulfilling the KeyValueDB
trait, living in memory.
This is generally intended for tests and is not particularly optimized.
Trait Implementations
impl Default for InMemory
[src]
impl Default for InMemory
impl KeyValueDB for InMemory
[src]
impl KeyValueDB for InMemory
fn get(&self, col: Option<u32>, key: &[u8]) -> Result<Option<DBValue>>
[src]
fn get(&self, col: Option<u32>, key: &[u8]) -> Result<Option<DBValue>>
Get a value by key.
fn get_by_prefix(&self, col: Option<u32>, prefix: &[u8]) -> Option<Box<[u8]>>
[src]
fn get_by_prefix(&self, col: Option<u32>, prefix: &[u8]) -> Option<Box<[u8]>>
Get a value by partial key. Only works for flushed data.
fn write_buffered(&self, transaction: DBTransaction)
[src]
fn write_buffered(&self, transaction: DBTransaction)
Write a transaction of changes to the buffer.
fn flush(&self) -> Result<()>
[src]
fn flush(&self) -> Result<()>
Flush all buffered data.
fn iter<'a>(
&'a self,
col: Option<u32>
) -> Box<Iterator<Item = (Box<[u8]>, Box<[u8]>)> + 'a>
[src]
fn iter<'a>(
&'a self,
col: Option<u32>
) -> Box<Iterator<Item = (Box<[u8]>, Box<[u8]>)> + 'a>
Iterate over flushed data for a given column.
fn iter_from_prefix<'a>(
&'a self,
col: Option<u32>,
prefix: &'a [u8]
) -> Box<Iterator<Item = (Box<[u8]>, Box<[u8]>)> + 'a>
[src]
fn iter_from_prefix<'a>(
&'a self,
col: Option<u32>,
prefix: &'a [u8]
) -> Box<Iterator<Item = (Box<[u8]>, Box<[u8]>)> + 'a>
Iterate over flushed data for a given column, starting from a given prefix.
fn restore(&self, _new_db: &str) -> Result<()>
[src]
fn restore(&self, _new_db: &str) -> Result<()>
Attempt to replace this database with a new one located at the given path.
fn transaction(&self) -> DBTransaction
[src]
fn transaction(&self) -> DBTransaction
Helper to create a new transaction.
fn write(&self, transaction: DBTransaction) -> Result<(), Error>
[src]
fn write(&self, transaction: DBTransaction) -> Result<(), Error>
Write a transaction of changes to the backing store.