ckb_rocksdb::ops

Trait GetPinned

Source
pub trait GetPinned<'a> {
    type ReadOptions;

    // Required method
    fn get_pinned_full<K: AsRef<[u8]>>(
        &'a self,
        key: K,
        readopts: Option<Self::ReadOptions>,
    ) -> Result<Option<DBPinnableSlice<'a>>, Error>;

    // Provided methods
    fn get_pinned<K: AsRef<[u8]>>(
        &'a self,
        key: K,
    ) -> Result<Option<DBPinnableSlice<'a>>, Error> { ... }
    fn get_pinned_opt<K: AsRef<[u8]>>(
        &'a self,
        key: K,
        readopts: Self::ReadOptions,
    ) -> Result<Option<DBPinnableSlice<'a>>, Error> { ... }
}

Required Associated Types§

Required Methods§

Source

fn get_pinned_full<K: AsRef<[u8]>>( &'a self, 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.

Provided Methods§

Source

fn get_pinned<K: AsRef<[u8]>>( &'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: AsRef<[u8]>>( &'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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

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