Struct ckb_db::read_only_db::ReadOnlyDB
source · pub struct ReadOnlyDB { /* private fields */ }Expand description
ReadOnlyDB wrapper
Implementations§
source§impl ReadOnlyDB
impl ReadOnlyDB
sourcepub fn open_cf<P, I, N>(path: P, cf_names: I) -> Result<Option<Self>>where
P: AsRef<Path>,
I: IntoIterator<Item = N>,
N: AsRef<str>,
pub fn open_cf<P, I, N>(path: P, cf_names: I) -> Result<Option<Self>>where P: AsRef<Path>, I: IntoIterator<Item = N>, N: AsRef<str>,
The behavior is similar to DB::Open, except that it opens DB in read-only mode. One big difference is that when opening the DB as read-only, you don’t need to specify all Column Families – you can only open a subset of Column Families.
sourcepub fn get_pinned_default(
&self,
key: &[u8]
) -> Result<Option<DBPinnableSlice<'_>>>
pub fn get_pinned_default( &self, key: &[u8] ) -> Result<Option<DBPinnableSlice<'_>>>
Return the value associated with a key using RocksDB’s PinnableSlice from the default column so as to avoid unnecessary memory copy.
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.