Struct rocksdb::Snapshot [−][src]
A consistent view of the database at the point of creation.
Examples
use rocksdb::{DB, IteratorMode, Options}; let path = "_path_for_rocksdb_storage3"; { let db = DB::open_default(path).unwrap(); let snapshot = db.snapshot(); // Creates a longer-term snapshot of the DB, but closed when goes out of scope let mut iter = snapshot.iterator(IteratorMode::Start); // Make as many iterators as you'd like from one snapshot } let _ = DB::destroy(&Options::default(), path);
Implementations
impl<'a> Snapshot<'a>
[src]
pub fn new(db: &DB) -> Snapshot<'_>
[src]
Creates a new Snapshot
of the database db
.
pub fn iterator(&self, mode: IteratorMode<'_>) -> DBIterator<'a>ⓘ
[src]
Creates an iterator over the data in this snapshot, using the default read options.
pub fn iterator_cf(
&self,
cf_handle: &ColumnFamily,
mode: IteratorMode<'_>
) -> DBIterator<'_>ⓘ
[src]
&self,
cf_handle: &ColumnFamily,
mode: IteratorMode<'_>
) -> DBIterator<'_>ⓘ
Creates an iterator over the data in this snapshot under the given column family, using the default read options.
pub fn iterator_opt(
&self,
mode: IteratorMode<'_>,
readopts: ReadOptions
) -> DBIterator<'a>ⓘ
[src]
&self,
mode: IteratorMode<'_>,
readopts: ReadOptions
) -> DBIterator<'a>ⓘ
Creates an iterator over the data in this snapshot, using the given read options.
pub fn iterator_cf_opt(
&self,
cf_handle: &ColumnFamily,
readopts: ReadOptions,
mode: IteratorMode<'_>
) -> DBIterator<'_>ⓘ
[src]
&self,
cf_handle: &ColumnFamily,
readopts: ReadOptions,
mode: IteratorMode<'_>
) -> DBIterator<'_>ⓘ
Creates an iterator over the data in this snapshot under the given column family, using the given read options.
pub fn raw_iterator(&self) -> DBRawIterator<'_>
[src]
Creates a raw iterator over the data in this snapshot, using the default read options.
pub fn raw_iterator_cf(&self, cf_handle: &ColumnFamily) -> DBRawIterator<'_>
[src]
Creates a raw iterator over the data in this snapshot under the given column family, using the default read options.
pub fn raw_iterator_opt(&self, readopts: ReadOptions) -> DBRawIterator<'_>
[src]
Creates a raw iterator over the data in this snapshot, using the given read options.
pub fn raw_iterator_cf_opt(
&self,
cf_handle: &ColumnFamily,
readopts: ReadOptions
) -> DBRawIterator<'_>
[src]
&self,
cf_handle: &ColumnFamily,
readopts: ReadOptions
) -> DBRawIterator<'_>
Creates a raw iterator over the data in this snapshot under the given column family, using the given read options.
pub fn get<K: AsRef<[u8]>>(&self, key: K) -> Result<Option<Vec<u8>>, Error>
[src]
Returns the bytes associated with a key value with default read options.
pub fn get_cf<K: AsRef<[u8]>>(
&self,
cf: &ColumnFamily,
key: K
) -> Result<Option<Vec<u8>>, Error>
[src]
&self,
cf: &ColumnFamily,
key: K
) -> Result<Option<Vec<u8>>, Error>
Returns the bytes associated with a key value and given column family with default read options.
pub fn get_opt<K: AsRef<[u8]>>(
&self,
key: K,
readopts: ReadOptions
) -> Result<Option<Vec<u8>>, Error>
[src]
&self,
key: K,
readopts: ReadOptions
) -> Result<Option<Vec<u8>>, Error>
Returns the bytes associated with a key value and given read options.
pub fn get_cf_opt<K: AsRef<[u8]>>(
&self,
cf: &ColumnFamily,
key: K,
readopts: ReadOptions
) -> Result<Option<Vec<u8>>, Error>
[src]
&self,
cf: &ColumnFamily,
key: K,
readopts: ReadOptions
) -> Result<Option<Vec<u8>>, Error>
Returns the bytes associated with a key value, given column family and read options.
Trait Implementations
impl<'a> Drop for Snapshot<'a>
[src]
impl<'a> Send for Snapshot<'a>
[src]
Send
and Sync
implementations for Snapshot
are safe, because Snapshot
is
immutable and can be safely shared between threads.
impl<'a> Sync for Snapshot<'a>
[src]
Auto Trait Implementations
impl<'a> RefUnwindSafe for Snapshot<'a>
impl<'a> Unpin for Snapshot<'a>
impl<'a> UnwindSafe for Snapshot<'a>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,