pub struct RocksDBSnapshot { /* private fields */ }
Expand description
A snapshot captures a point-in-time view of the DB at the time it’s created
Implementations§
Source§impl RocksDBSnapshot
impl RocksDBSnapshot
Sourcepub unsafe fn new(
db: &Arc<OptimisticTransactionDB>,
ptr: *const rocksdb_snapshot_t,
) -> RocksDBSnapshot
pub unsafe fn new( db: &Arc<OptimisticTransactionDB>, ptr: *const rocksdb_snapshot_t, ) -> RocksDBSnapshot
§Safety
This function is unsafe because it take raw pointer as arguments
Sourcepub fn get_pinned(
&self,
col: Col,
key: &[u8],
) -> Result<Option<DBPinnableSlice<'_>>>
pub fn get_pinned( &self, col: Col, key: &[u8], ) -> Result<Option<DBPinnableSlice<'_>>>
Return the value associated with a key using RocksDB’s PinnableSlice from the given column so as to avoid unnecessary memory copy.
Trait Implementations§
Source§impl ConstHandle<rocksdb_snapshot_t> for RocksDBSnapshot
impl ConstHandle<rocksdb_snapshot_t> for RocksDBSnapshot
fn const_handle(&self) -> *const rocksdb_snapshot_t
Source§impl DBIterator for RocksDBSnapshot
impl DBIterator for RocksDBSnapshot
Source§fn iter_opt(
&self,
col: Col,
mode: IteratorMode<'_>,
readopts: &ReadOptions,
) -> Result<DBIter<'_>>
fn iter_opt( &self, col: Col, mode: IteratorMode<'_>, readopts: &ReadOptions, ) -> Result<DBIter<'_>>
Opens an iterator using the provided IteratorMode and ReadOptions.
This is used when you want to iterate over a specific ColumnFamily with a modified ReadOptions
Source§impl Drop for RocksDBSnapshot
impl Drop for RocksDBSnapshot
Source§impl<'a> GetPinnedCF<'a> for RocksDBSnapshot
impl<'a> GetPinnedCF<'a> for RocksDBSnapshot
type ColumnFamily = &'a ColumnFamily
type ReadOptions = &'a ReadOptions
Source§fn get_pinned_cf_full<K: AsRef<[u8]>>(
&'a self,
cf: Option<Self::ColumnFamily>,
key: K,
readopts: Option<Self::ReadOptions>,
) -> Result<Option<DBPinnableSlice<'a>>, Error>
fn get_pinned_cf_full<K: AsRef<[u8]>>( &'a self, cf: Option<Self::ColumnFamily>, key: K, readopts: Option<Self::ReadOptions>, ) -> Result<Option<DBPinnableSlice<'a>>, Error>
Return the value associated with a key using RocksDB’s PinnableSlice
so as to avoid unnecessary memory copy.
Source§fn get_pinned_cf<K>(
&'a self,
cf: Self::ColumnFamily,
key: K,
) -> Result<Option<DBPinnableSlice<'a>>, Error>
fn get_pinned_cf<K>( &'a self, cf: Self::ColumnFamily, key: K, ) -> Result<Option<DBPinnableSlice<'a>>, Error>
Return the value associated with a key using RocksDB’s PinnableSlice
so as to avoid unnecessary memory copy.
Source§fn get_pinned_cf_opt<K>(
&'a self,
cf: Self::ColumnFamily,
key: K,
readopts: Self::ReadOptions,
) -> Result<Option<DBPinnableSlice<'a>>, Error>
fn get_pinned_cf_opt<K>( &'a self, cf: Self::ColumnFamily, key: K, readopts: Self::ReadOptions, ) -> Result<Option<DBPinnableSlice<'a>>, Error>
Return the value associated with a key using RocksDB’s PinnableSlice
so as to avoid unnecessary memory copy.
Source§impl Iterate for RocksDBSnapshot
impl Iterate for RocksDBSnapshot
fn get_raw_iter<'a: 'b, 'b>( &'a self, readopts: &ReadOptions, ) -> DBRawIterator<'b>
fn get_iter<'a, 'b>(
&'a self,
readopts: &ReadOptions,
mode: IteratorMode<'_>,
) -> DBIterator<'b> ⓘwhere
'a: 'b,
fn iterator_opt<'a, 'b>(
&'a self,
mode: IteratorMode<'_>,
readopts: &ReadOptions,
) -> DBIterator<'b> ⓘwhere
'a: 'b,
fn iterator<'a, 'b>(&'a self, mode: IteratorMode<'_>) -> DBIterator<'b> ⓘwhere
'a: 'b,
Source§fn full_iterator<'a, 'b>(&'a self, mode: IteratorMode<'_>) -> DBIterator<'b> ⓘwhere
'a: 'b,
fn full_iterator<'a, 'b>(&'a self, mode: IteratorMode<'_>) -> DBIterator<'b> ⓘwhere
'a: 'b,
Opens an interator with
set_total_order_seek
enabled.
This must be used to iterate across prefixes when set_memtable_factory
has been called
with a Hash-based implementation.fn prefix_iterator<'a, 'b>(&'a self, prefix: &[u8]) -> DBIterator<'b> ⓘwhere
'a: 'b,
fn raw_iterator<'a, 'b>(&'a self) -> DBRawIterator<'b>where
'a: 'b,
Source§impl IterateCF for RocksDBSnapshot
impl IterateCF for RocksDBSnapshot
fn get_raw_iter_cf<'a: 'b, 'b>( &'a self, cf_handle: &ColumnFamily, readopts: &ReadOptions, ) -> Result<DBRawIterator<'b>, Error>
fn get_iter_cf<'a, 'b>(
&'a self,
cf_handle: &ColumnFamily,
readopts: &ReadOptions,
mode: IteratorMode<'_>,
) -> Result<DBIterator<'b>, Error>where
'a: 'b,
Source§fn iterator_cf_opt<'a, 'b>(
&'a self,
cf_handle: &ColumnFamily,
mode: IteratorMode<'_>,
readopts: &ReadOptions,
) -> Result<DBIterator<'b>, Error>where
'a: 'b,
fn iterator_cf_opt<'a, 'b>(
&'a self,
cf_handle: &ColumnFamily,
mode: IteratorMode<'_>,
readopts: &ReadOptions,
) -> Result<DBIterator<'b>, Error>where
'a: 'b,
Opens an interator using the provided ReadOptions.
This is used when you want to iterate over a specific ColumnFamily with a modified ReadOptions
fn iterator_cf<'a, 'b>(
&'a self,
cf_handle: &ColumnFamily,
mode: IteratorMode<'_>,
) -> Result<DBIterator<'b>, Error>where
'a: 'b,
fn full_iterator_cf<'a, 'b>(
&'a self,
cf_handle: &ColumnFamily,
mode: IteratorMode<'_>,
) -> Result<DBIterator<'b>, Error>where
'a: 'b,
fn prefix_iterator_cf<'a, 'b>(
&'a self,
cf_handle: &ColumnFamily,
prefix: &[u8],
) -> Result<DBIterator<'b>, Error>where
'a: 'b,
fn raw_iterator_cf<'a, 'b>(
&'a self,
cf_handle: &ColumnFamily,
) -> Result<DBRawIterator<'b>, Error>where
'a: 'b,
impl Read for RocksDBSnapshot
impl Send for RocksDBSnapshot
impl Sync for RocksDBSnapshot
Auto Trait Implementations§
impl Freeze for RocksDBSnapshot
impl RefUnwindSafe for RocksDBSnapshot
impl Unpin for RocksDBSnapshot
impl UnwindSafe for RocksDBSnapshot
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<'a, T, R> GetPinned<'a> for Twhere
T: GetPinnedCF<'a, ReadOptions = R>,
impl<'a, T, R> GetPinned<'a> for Twhere
T: GetPinnedCF<'a, ReadOptions = R>,
type ReadOptions = R
Source§fn get_pinned_full<K>(
&'a self,
key: K,
readopts: Option<<T as GetPinned<'a>>::ReadOptions>,
) -> Result<Option<DBPinnableSlice<'a>>, Error>
fn get_pinned_full<K>( &'a self, key: K, readopts: Option<<T as GetPinned<'a>>::ReadOptions>, ) -> Result<Option<DBPinnableSlice<'a>>, Error>
Return the value associated with a key using RocksDB’s PinnableSlice
so as to avoid unnecessary memory copy.
Source§fn get_pinned<K>(&'a self, key: K) -> Result<Option<DBPinnableSlice<'a>>, Error>
fn get_pinned<K>(&'a self, key: K) -> Result<Option<DBPinnableSlice<'a>>, 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§fn get_pinned_opt<K>(
&'a self,
key: K,
readopts: Self::ReadOptions,
) -> Result<Option<DBPinnableSlice<'a>>, Error>
fn get_pinned_opt<K>( &'a self, key: K, readopts: Self::ReadOptions, ) -> Result<Option<DBPinnableSlice<'a>>, Error>
Return the value associated with a key using RocksDB’s PinnableSlice
so as to avoid unnecessary memory copy.
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more