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§
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>>
fn multi_get_cf_opt<'b, K, I, W>( &self, keys_cf: I, readopts: &ReadOptions, ) -> Vec<Result<Option<Vec<u8>>, Error>>
Object Safety§
This trait is not object safe.