Trait rocksdb::DBAccess

source ·
pub trait DBAccess {
    // Required methods
    unsafe fn create_snapshot(&self) -> *const rocksdb_snapshot_t;
    unsafe fn release_snapshot(&self, snapshot: *const rocksdb_snapshot_t);
    unsafe fn create_iterator(
        &self,
        readopts: &ReadOptions,
    ) -> *mut rocksdb_iterator_t;
    unsafe fn create_iterator_cf(
        &self,
        cf_handle: *mut rocksdb_column_family_handle_t,
        readopts: &ReadOptions,
    ) -> *mut rocksdb_iterator_t;
    fn get_opt<K: AsRef<[u8]>>(
        &self,
        key: K,
        readopts: &ReadOptions,
    ) -> Result<Option<Vec<u8>>, Error>;
    fn get_cf_opt<K: AsRef<[u8]>>(
        &self,
        cf: &impl AsColumnFamilyRef,
        key: K,
        readopts: &ReadOptions,
    ) -> Result<Option<Vec<u8>>, Error>;
    fn get_pinned_opt<K: AsRef<[u8]>>(
        &self,
        key: K,
        readopts: &ReadOptions,
    ) -> Result<Option<DBPinnableSlice<'_>>, Error>;
    fn get_pinned_cf_opt<K: AsRef<[u8]>>(
        &self,
        cf: &impl AsColumnFamilyRef,
        key: K,
        readopts: &ReadOptions,
    ) -> Result<Option<DBPinnableSlice<'_>>, Error>;
    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>;
    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;
}
Expand description

Minimal set of DB-related methods, intended to be generic over DBWithThreadMode<T>. Mainly used internally

Required Methods§

source

unsafe fn create_snapshot(&self) -> *const rocksdb_snapshot_t

source

unsafe fn release_snapshot(&self, snapshot: *const rocksdb_snapshot_t)

source

unsafe fn create_iterator( &self, readopts: &ReadOptions, ) -> *mut rocksdb_iterator_t

source

unsafe fn create_iterator_cf( &self, cf_handle: *mut rocksdb_column_family_handle_t, readopts: &ReadOptions, ) -> *mut rocksdb_iterator_t

source

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

source

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

source

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

source

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

source

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>,

source

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,

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<'db, DB> DBAccess for Transaction<'db, DB>

source§

impl<T: ThreadMode> DBAccess for TransactionDB<T>

source§

impl<T: ThreadMode, D: DBInner> DBAccess for DBCommon<T, D>