pub struct InFile { /* private fields */ }
Expand description
A key-value database fulfilling the KeyValueDB
trait, living in file.
This is generally intended for tests and is not particularly optimized.
Implementations§
Trait Implementations§
Source§impl KeyValueDB for InFile
impl KeyValueDB for InFile
Source§fn get_by_prefix(&self, col: u32, prefix: &[u8]) -> Result<Option<Vec<u8>>>
fn get_by_prefix(&self, col: u32, prefix: &[u8]) -> Result<Option<Vec<u8>>>
Get the first value matching the given prefix.
Source§fn write(&self, transaction: DBTransaction) -> Result<()>
fn write(&self, transaction: DBTransaction) -> Result<()>
Write a transaction of changes to the backing store.
Source§fn iter<'a>(
&'a self,
col: u32,
) -> Box<dyn Iterator<Item = Result<DBKeyValue>> + 'a>
fn iter<'a>( &'a self, col: u32, ) -> Box<dyn Iterator<Item = Result<DBKeyValue>> + 'a>
Iterate over the data for a given column.
Source§fn iter_with_prefix<'a>(
&'a self,
col: u32,
prefix: &'a [u8],
) -> Box<dyn Iterator<Item = Result<DBKeyValue>> + 'a>
fn iter_with_prefix<'a>( &'a self, col: u32, prefix: &'a [u8], ) -> Box<dyn Iterator<Item = Result<DBKeyValue>> + 'a>
Iterate over the data for a given column, returning all key/value pairs
where the key starts with the given prefix.
Source§fn transaction(&self) -> DBTransaction
fn transaction(&self) -> DBTransaction
Helper to create a new transaction.
Auto Trait Implementations§
impl !Freeze for InFile
impl !RefUnwindSafe for InFile
impl Send for InFile
impl Sync for InFile
impl Unpin for InFile
impl UnwindSafe for InFile
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