[−][src]Trait exonum::storage::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.
Note. Unless stated otherwise, "key" in the method descriptions below refers to a full key (a string column family name + key as an array of bytes within the family).
Required methods
fn get(&self, name: &str, key: &[u8]) -> Option<Vec<u8>>
Returns a value corresponding to the specified key as a raw vector of bytes,
or None
if it does not exist.
fn iter<'a>(&'a self, name: &str, from: &[u8]) -> Iter<'a>
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: &str, key: &[u8]) -> bool
Returns true
if the snapshot contains a value for the specified key.
Default implementation checks existence of the value using get
.
Trait Implementations
impl AsRef<dyn Snapshot + 'static> for dyn Snapshot + 'static
[src]
impl AsRef<dyn Snapshot + 'static> for dyn Snapshot + 'static
impl AsRef<dyn Snapshot + 'static> for Fork
[src]
impl AsRef<dyn Snapshot + 'static> for Fork
Implementors
impl Snapshot for Fork
[src]
impl Snapshot for Fork
fn get(&self, name: &str, key: &[u8]) -> Option<Vec<u8>> | [src] |
fn contains(&self, name: &str, key: &[u8]) -> bool | [src] |
fn iter<'a>(&'a self, name: &str, from: &[u8]) -> Iter<'a> | [src] |
impl Snapshot for MemoryDB
[src]
impl Snapshot for MemoryDB