Trait matterdb::Snapshot [−][src]
pub trait Snapshot: Send + Sync + 'static { fn get(&self, name: &ResolvedAddress, key: &[u8]) -> Option<Vec<u8>>; fn iter(&self, name: &ResolvedAddress, from: &[u8]) -> Iter<'_>; fn contains(&self, name: &ResolvedAddress, key: &[u8]) -> bool { ... } }
A read-only snapshot of a storage backend.
A Snapshot
instance is an immutable representation of a certain storage state.
It provides read isolation, so consistency is guaranteed even if the data in
the database changes between reads.
Required methods
fn get(&self, name: &ResolvedAddress, key: &[u8]) -> Option<Vec<u8>>
[src]
Returns a value corresponding to the specified address and key as a raw vector of bytes,
or None
if it does not exist.
fn iter(&self, name: &ResolvedAddress, from: &[u8]) -> Iter<'_>
[src]
Returns an iterator over the entries of the snapshot in ascending order starting from
the specified key. The iterator element type is (&[u8], &[u8])
.
Provided methods
fn contains(&self, name: &ResolvedAddress, key: &[u8]) -> bool
[src]
Returns true
if the snapshot contains a value for the specified address and key.
The default implementation checks existence of the value using get
.
Trait Implementations
impl AsReadonly for &dyn Snapshot
[src]
impl AsReadonly for &dyn Snapshot
[src]type Readonly = Self
type Readonly = Self
Readonly version of the access.
fn as_readonly(&self) -> Self::Readonly
[src]
fn as_readonly(&self) -> Self::Readonly
[src]Performs the conversion.
impl<'a> From<&'a (dyn Snapshot + 'static)> for GenericRawAccess<'a>
[src]
impl<'a> From<&'a (dyn Snapshot + 'static)> for GenericRawAccess<'a>
[src]impl<'a> IntoErased<'a> for &'a dyn Snapshot
[src]
impl<'a> IntoErased<'a> for &'a dyn Snapshot
[src]fn into_erased(self) -> ErasedAccess<'a>
[src]
fn into_erased(self) -> ErasedAccess<'a>
[src]Performs the conversion.
impl RawAccess for &dyn Snapshot
[src]
impl RawAccess for &dyn Snapshot
[src]Implementations on Foreign Types
Loading content...Implementors
impl Snapshot for RocksDBSnapshot
[src]
impl Snapshot for RocksDBSnapshot
[src]