ckb_db::snapshot

Struct RocksDBSnapshot

Source
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

Source

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

Source

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

Source§

impl DBIterator for RocksDBSnapshot

Source§

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§

fn iter(&self, col: Col, mode: IteratorMode<'_>) -> Result<DBIter<'_>>

Opens an iterator using the provided IteratorMode. This is used when you want to iterate over a specific ColumnFamily
Source§

impl Drop for RocksDBSnapshot

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl<'a> GetPinnedCF<'a> for RocksDBSnapshot

Source§

type ColumnFamily = &'a ColumnFamily

Source§

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>

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>
where K: AsRef<[u8]>,

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>
where K: AsRef<[u8]>,

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

impl Iterate for RocksDBSnapshot

Source§

fn get_raw_iter<'a: 'b, 'b>( &'a self, readopts: &ReadOptions, ) -> DBRawIterator<'b>

Source§

fn get_iter<'a, 'b>( &'a self, readopts: &ReadOptions, mode: IteratorMode<'_>, ) -> DBIterator<'b>
where 'a: 'b,

Source§

fn iterator_opt<'a, 'b>( &'a self, mode: IteratorMode<'_>, readopts: &ReadOptions, ) -> DBIterator<'b>
where 'a: 'b,

Source§

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,

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.
Source§

fn prefix_iterator<'a, 'b>(&'a self, prefix: &[u8]) -> DBIterator<'b>
where 'a: 'b,

Source§

fn raw_iterator<'a, 'b>(&'a self) -> DBRawIterator<'b>
where 'a: 'b,

Source§

impl IterateCF for RocksDBSnapshot

Source§

fn get_raw_iter_cf<'a: 'b, 'b>( &'a self, cf_handle: &ColumnFamily, readopts: &ReadOptions, ) -> Result<DBRawIterator<'b>, Error>

Source§

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,

Opens an interator using the provided ReadOptions. This is used when you want to iterate over a specific ColumnFamily with a modified ReadOptions
Source§

fn iterator_cf<'a, 'b>( &'a self, cf_handle: &ColumnFamily, mode: IteratorMode<'_>, ) -> Result<DBIterator<'b>, Error>
where 'a: 'b,

Source§

fn full_iterator_cf<'a, 'b>( &'a self, cf_handle: &ColumnFamily, mode: IteratorMode<'_>, ) -> Result<DBIterator<'b>, Error>
where 'a: 'b,

Source§

fn prefix_iterator_cf<'a, 'b>( &'a self, cf_handle: &ColumnFamily, prefix: &[u8], ) -> Result<DBIterator<'b>, Error>
where 'a: 'b,

Source§

fn raw_iterator_cf<'a, 'b>( &'a self, cf_handle: &ColumnFamily, ) -> Result<DBRawIterator<'b>, Error>
where 'a: 'b,

Source§

impl Read for RocksDBSnapshot

Source§

impl Send for RocksDBSnapshot

Source§

impl Sync for RocksDBSnapshot

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> AsAny for T
where T: Any,

Source§

fn as_any(&self) -> &(dyn Any + 'static)

Cast to trait Any
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<'a, T, R> GetPinned<'a> for T
where T: GetPinnedCF<'a, ReadOptions = R>,

Source§

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>
where K: AsRef<[u8]>,

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>
where K: AsRef<[u8]>,

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>
where K: AsRef<[u8]>,

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

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T