[][src]Trait exonum_merkledb::Snapshot

pub trait Snapshot: Send + Sync + 'static {
    fn get(&self, name: &str, key: &[u8]) -> Option<Vec<u8>>;
fn iter(&self, name: &str, from: &[u8]) -> Iter; fn contains(&self, name: &str, 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.

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(&self, name: &str, 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]).

Loading content...

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.

Loading content...

Trait Implementations

impl AsRef<dyn Snapshot + 'static> for Fork[src]

impl AsRef<dyn Snapshot + 'static> for dyn Snapshot + 'static[src]

impl Debug for dyn Snapshot[src]

Implementors

impl Snapshot for Patch[src]

Loading content...