Struct Table

Source
pub struct Table<T> { /* private fields */ }
Expand description

RocksDB column family wrapper.

Implementations§

Source§

impl<T> Table<T>
where T: ColumnFamily,

Source

pub fn new(db: Arc<DB>) -> Self

Creates a column family wrapper instance.

Source

pub fn cf(&self) -> BoundedCfHandle<'_>

Returns a bounded column family handle.

Source

pub fn get_unbounded_cf(&self) -> UnboundedCfHandle

Returns an unbounded column family handle.

Source

pub fn db(&self) -> &Arc<DB>

Returns an inner rocksdb instance.

Source

pub fn read_config(&self) -> &ReadOptions

Returns an existing read config.

Source

pub fn new_read_config(&self) -> ReadOptions

Creates a new read config with options applied.

Source

pub fn write_config(&self) -> &WriteOptions

Returns an existing write config.

Source

pub fn new_write_config(&self) -> WriteOptions

Creates a new write config with options applied.

Source

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

Gets a value from the DB.

Source

pub fn get_owned<K: AsRef<[u8]>>( &self, key: K, ) -> Result<Option<OwnedPinnableSlice>, Error>

Gets a value from the DB.

Source

pub fn multi_get<K: AsRef<[u8]>>( &self, keys: &[K], ) -> Vec<Result<Option<Vec<u8>>, Error>>

Gets multiple values from the DB.

Source

pub fn batched_multi_get<K: AsRef<[u8]>>( &self, keys: &[K], sorted_input: bool, ) -> Vec<Result<Option<DBPinnableSlice<'_>>, Error>>

Gets multiple values from the DB.

Source

pub fn insert<K, V>(&self, key: K, value: V) -> Result<(), Error>
where K: AsRef<[u8]>, V: AsRef<[u8]>,

Inserts a new value into the DB.

Source

pub fn remove<K: AsRef<[u8]>>(&self, key: K) -> Result<(), Error>

Removes a value from the DB.

Source

pub fn contains_key<K: AsRef<[u8]>>(&self, key: K) -> Result<bool, Error>

Checks whether the specified key is present in the DB.

Source

pub fn iterator(&self, mode: IteratorMode<'_>) -> DBIterator<'_>

Creates an iterator with the specified mode and default read options.

Source

pub fn prefix_iterator<P>(&self, prefix: P) -> DBRawIterator<'_>
where P: AsRef<[u8]>,

Creates a prefix iterator with the specified prefix and default read options.

Source

pub fn raw_iterator(&self) -> DBRawIterator<'_>

Creates a raw iterator with default read options.

Auto Trait Implementations§

§

impl<T> Freeze for Table<T>

§

impl<T> RefUnwindSafe for Table<T>
where T: RefUnwindSafe,

§

impl<T> Send for Table<T>
where T: Send,

§

impl<T> Sync for Table<T>
where T: Sync,

§

impl<T> Unpin for Table<T>
where T: Unpin,

§

impl<T> UnwindSafe for Table<T>
where T: UnwindSafe,

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more