[][src]Struct exonum_rocksdb::Snapshot

pub struct Snapshot<'a> { /* fields omitted */ }

A consistent view of the database at the point of creation.

extern crate tempdir;
extern crate exonum_rocksdb;

use exonum_rocksdb::{DB, IteratorMode};
use tempdir::TempDir;

let temp_dir = TempDir::new("storage1").unwrap();
let mut db = DB::open_default(temp_dir.path()).unwrap();
let snapshot = db.snapshot(); // Creates a longer-term snapshot of the DB
let mut iter = snapshot.iterator(IteratorMode::Start); // Make as many iterators as you'd like

Methods

impl<'a> Snapshot<'a>[src]

pub fn new(db: &DB) -> Snapshot[src]

Important traits for DBIterator
pub fn iterator(&self, mode: IteratorMode) -> DBIterator[src]

pub fn iterator_cf(
    &self,
    cf_handle: ColumnFamily,
    mode: IteratorMode
) -> Result<DBIterator, Error>
[src]

pub fn raw_iterator(&self) -> DBRawIterator[src]

pub fn raw_iterator_cf(
    &self,
    cf_handle: ColumnFamily
) -> Result<DBRawIterator, Error>
[src]

pub fn get(&self, key: &[u8]) -> Result<Option<DBVector>, Error>[src]

pub fn get_cf(
    &self,
    cf: ColumnFamily,
    key: &[u8]
) -> Result<Option<DBVector>, Error>
[src]

Trait Implementations

impl<'a> Drop for Snapshot<'a>[src]

Auto Trait Implementations

impl<'a> !Send for Snapshot<'a>

impl<'a> !Sync for Snapshot<'a>

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]