RocksDbOptimisticColumn

Struct RocksDbOptimisticColumn 

Source
pub struct RocksDbOptimisticColumn { /* private fields */ }
Expand description

A RocksDB database column family.

Implementations§

Trait Implementations§

Source§

impl DBColumn for RocksDbOptimisticColumn

Source§

fn set(&self, key: impl AsRef<[u8]>, val: impl AsRef<[u8]>) -> Result<()>

Set a key-value pair.
Source§

fn get(&self, key: impl AsRef<[u8]>) -> Result<Option<Vec<u8>>>

Get a value by key.
Source§

fn contains(&self, key: impl AsRef<[u8]>) -> Result<bool>

Check if a key exists.
Source§

fn delete(&self, key: impl AsRef<[u8]>) -> Result<()>

Delete a key-value pair.
Source§

fn get_multi<I>(&self, keys: I) -> Result<Vec<Option<Vec<u8>>>>
where I: IntoIterator, I::Item: AsRef<[u8]>,

Get a value by key in batch.
Source§

fn set_nx( &self, key: impl AsRef<[u8]>, val: impl AsRef<[u8]>, ) -> Result<bool, Error>

Set a key-value pair if the key does not exist.
Source§

impl DBColumnDelete for RocksDbOptimisticColumn

Source§

fn delete_db(&self) -> Result<()>

Delete the database. Note that this will delete all data in the database. After calling this method, the database should not be used anymore or it will panic.
Source§

impl DBColumnIterator for RocksDbOptimisticColumn

Source§

fn iter( &self, ) -> Result<Box<dyn Iterator<Item = Result<(Vec<u8>, Vec<u8>)>> + '_>>

Create a new iterator.
Source§

impl DBColumnIteratorPrefix for RocksDbOptimisticColumn

Source§

fn iter_prefix( &self, prefix: impl AsRef<[u8]>, ) -> Result<Box<dyn Iterator<Item = Result<(Vec<u8>, Vec<u8>)>> + '_>>

Create a new iterator.
Source§

impl<'c> DBColumnRef<'c> for RocksDbOptimisticColumn

Source§

type Ref = DBPinnableSlice<'c>

The type of the ‘column’, this is a reference to a database.
Source§

fn get_ref(&'c self, key: impl AsRef<[u8]>) -> Result<Option<Self::Ref>>

Get a value by key.
Source§

impl<'a> DBColumnTransaction<'a> for RocksDbOptimisticColumn

Source§

type Txn = RocksDBTransaction<'a, DBCommon<MultiThreaded, OptimisticTransactionDBInner>>

Source§

fn transaction(&'a self) -> Result<Self::Txn>

Start a transaction.

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