[−][src]Trait exonum_merkledb::Snapshot
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>>
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
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
Returns true
if the snapshot contains a value for the specified address and key.
The default implementation checks existence of the value using get
.