rocksdb

Type Alias Snapshot

Source
pub type Snapshot<'a> = SnapshotWithThreadMode<'a, DB>;
Expand description

A type alias to keep compatibility. See SnapshotWithThreadMode for details

Aliased Type§

struct Snapshot<'a> { /* private fields */ }

Implementations

Source§

impl<'a, D: DBAccess> SnapshotWithThreadMode<'a, D>

Source

pub fn new(db: &'a D) -> Self

Creates a new SnapshotWithThreadMode of the database db.

Source

pub fn iterator( &self, mode: IteratorMode<'_>, ) -> DBIteratorWithThreadMode<'a, D>

Creates an iterator over the data in this snapshot, using the default read options.

Source

pub fn iterator_cf( &self, cf_handle: &impl AsColumnFamilyRef, mode: IteratorMode<'_>, ) -> DBIteratorWithThreadMode<'_, D>

Creates an iterator over the data in this snapshot under the given column family, using the default read options.

Source

pub fn iterator_opt( &self, mode: IteratorMode<'_>, readopts: ReadOptions, ) -> DBIteratorWithThreadMode<'a, D>

Creates an iterator over the data in this snapshot, using the given read options.

Source

pub fn iterator_cf_opt( &self, cf_handle: &impl AsColumnFamilyRef, readopts: ReadOptions, mode: IteratorMode<'_>, ) -> DBIteratorWithThreadMode<'_, D>

Creates an iterator over the data in this snapshot under the given column family, using the given read options.

Source

pub fn raw_iterator(&self) -> DBRawIteratorWithThreadMode<'_, D>

Creates a raw iterator over the data in this snapshot, using the default read options.

Source

pub fn raw_iterator_cf( &self, cf_handle: &impl AsColumnFamilyRef, ) -> DBRawIteratorWithThreadMode<'_, D>

Creates a raw iterator over the data in this snapshot under the given column family, using the default read options.

Source

pub fn raw_iterator_opt( &self, readopts: ReadOptions, ) -> DBRawIteratorWithThreadMode<'_, D>

Creates a raw iterator over the data in this snapshot, using the given read options.

Source

pub fn raw_iterator_cf_opt( &self, cf_handle: &impl AsColumnFamilyRef, readopts: ReadOptions, ) -> DBRawIteratorWithThreadMode<'_, D>

Creates a raw iterator over the data in this snapshot under the given column family, using the given read options.

Source

pub fn get<K: AsRef<[u8]>>(&self, key: K) -> Result<Option<Vec<u8>>, Error>

Returns the bytes associated with a key value with default read options.

Source

pub fn get_cf<K: AsRef<[u8]>>( &self, cf: &impl AsColumnFamilyRef, key: K, ) -> Result<Option<Vec<u8>>, Error>

Returns the bytes associated with a key value and given column family with default read options.

Source

pub fn get_opt<K: AsRef<[u8]>>( &self, key: K, readopts: ReadOptions, ) -> Result<Option<Vec<u8>>, Error>

Returns the bytes associated with a key value and given read options.

Source

pub fn get_cf_opt<K: AsRef<[u8]>>( &self, cf: &impl AsColumnFamilyRef, key: K, readopts: ReadOptions, ) -> Result<Option<Vec<u8>>, Error>

Returns the bytes associated with a key value, given column family and read options.

Source

pub fn get_pinned<K: AsRef<[u8]>>( &self, key: K, ) -> Result<Option<DBPinnableSlice<'_>>, Error>

Return the value associated with a key using RocksDB’s PinnableSlice so as to avoid unnecessary memory copy. Similar to get_pinned_opt but leverages default options.

Source

pub fn get_pinned_cf<K: AsRef<[u8]>>( &self, cf: &impl AsColumnFamilyRef, key: K, ) -> Result<Option<DBPinnableSlice<'_>>, Error>

Return the value associated with a key using RocksDB’s PinnableSlice so as to avoid unnecessary memory copy. Similar to get_pinned_cf_opt but leverages default options.

Source

pub fn get_pinned_opt<K: AsRef<[u8]>>( &self, key: K, readopts: ReadOptions, ) -> Result<Option<DBPinnableSlice<'_>>, Error>

Return the value associated with a key using RocksDB’s PinnableSlice so as to avoid unnecessary memory copy.

Source

pub fn get_pinned_cf_opt<K: AsRef<[u8]>>( &self, cf: &impl AsColumnFamilyRef, key: K, readopts: ReadOptions, ) -> Result<Option<DBPinnableSlice<'_>>, Error>

Return the value associated with a key using RocksDB’s PinnableSlice so as to avoid unnecessary memory copy. Similar to get_pinned_opt but allows specifying ColumnFamily.

Source

pub fn multi_get<K: AsRef<[u8]>, I>( &self, keys: I, ) -> Vec<Result<Option<Vec<u8>>, Error>>
where I: IntoIterator<Item = K>,

Returns the bytes associated with the given key values and default read options.

Source

pub fn multi_get_cf<'b, K, I, W>( &self, keys_cf: I, ) -> Vec<Result<Option<Vec<u8>>, Error>>
where K: AsRef<[u8]>, I: IntoIterator<Item = (&'b W, K)>, W: AsColumnFamilyRef + 'b,

Returns the bytes associated with the given key values and default read options.

Source

pub fn multi_get_opt<K, I>( &self, keys: I, readopts: ReadOptions, ) -> Vec<Result<Option<Vec<u8>>, Error>>
where K: AsRef<[u8]>, I: IntoIterator<Item = K>,

Returns the bytes associated with the given key values and given read options.

Source

pub fn multi_get_cf_opt<'b, K, I, W>( &self, keys_cf: I, readopts: ReadOptions, ) -> Vec<Result<Option<Vec<u8>>, Error>>
where K: AsRef<[u8]>, I: IntoIterator<Item = (&'b W, K)>, W: AsColumnFamilyRef + 'b,

Returns the bytes associated with the given key values, given column family and read options.

Trait Implementations

Source§

impl<'a, D: DBAccess> Drop for SnapshotWithThreadMode<'a, D>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl<'a, D: DBAccess> Send for SnapshotWithThreadMode<'a, D>

Send and Sync implementations for SnapshotWithThreadMode are safe, because SnapshotWithThreadMode is immutable and can be safely shared between threads.

Source§

impl<'a, D: DBAccess> Sync for SnapshotWithThreadMode<'a, D>