pub struct Table<T> { /* private fields */ }
Expand description
RocksDB column family wrapper.
Implementations§
Source§impl<T> Table<T>where
T: ColumnFamily,
impl<T> Table<T>where
T: ColumnFamily,
Sourcepub fn cf(&self) -> BoundedCfHandle<'_>
pub fn cf(&self) -> BoundedCfHandle<'_>
Returns a bounded column family handle.
Sourcepub fn get_unbounded_cf(&self) -> UnboundedCfHandle
pub fn get_unbounded_cf(&self) -> UnboundedCfHandle
Returns an unbounded column family handle.
Sourcepub fn read_config(&self) -> &ReadOptions
pub fn read_config(&self) -> &ReadOptions
Returns an existing read config.
Sourcepub fn new_read_config(&self) -> ReadOptions
pub fn new_read_config(&self) -> ReadOptions
Creates a new read config with options applied.
Sourcepub fn write_config(&self) -> &WriteOptions
pub fn write_config(&self) -> &WriteOptions
Returns an existing write config.
Sourcepub fn new_write_config(&self) -> WriteOptions
pub fn new_write_config(&self) -> WriteOptions
Creates a new write config with options applied.
Sourcepub fn get<K: AsRef<[u8]>>(
&self,
key: K,
) -> Result<Option<DBPinnableSlice<'_>>, Error>
pub fn get<K: AsRef<[u8]>>( &self, key: K, ) -> Result<Option<DBPinnableSlice<'_>>, Error>
Gets a value from the DB.
Sourcepub fn get_owned<K: AsRef<[u8]>>(
&self,
key: K,
) -> Result<Option<OwnedPinnableSlice>, Error>
pub fn get_owned<K: AsRef<[u8]>>( &self, key: K, ) -> Result<Option<OwnedPinnableSlice>, Error>
Gets a value from the DB.
Sourcepub fn multi_get<K: AsRef<[u8]>>(
&self,
keys: &[K],
) -> Vec<Result<Option<Vec<u8>>, Error>>
pub fn multi_get<K: AsRef<[u8]>>( &self, keys: &[K], ) -> Vec<Result<Option<Vec<u8>>, Error>>
Gets multiple values from the DB.
Sourcepub fn batched_multi_get<K: AsRef<[u8]>>(
&self,
keys: &[K],
sorted_input: bool,
) -> Vec<Result<Option<DBPinnableSlice<'_>>, Error>>
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.
Sourcepub fn insert<K, V>(&self, key: K, value: V) -> Result<(), Error>
pub fn insert<K, V>(&self, key: K, value: V) -> Result<(), Error>
Inserts a new value into the DB.
Sourcepub fn contains_key<K: AsRef<[u8]>>(&self, key: K) -> Result<bool, Error>
pub fn contains_key<K: AsRef<[u8]>>(&self, key: K) -> Result<bool, Error>
Checks whether the specified key is present in the DB.
Sourcepub fn iterator(&self, mode: IteratorMode<'_>) -> DBIterator<'_>
pub fn iterator(&self, mode: IteratorMode<'_>) -> DBIterator<'_>
Creates an iterator with the specified mode and default read options.
Sourcepub fn prefix_iterator<P>(&self, prefix: P) -> DBRawIterator<'_>
pub fn prefix_iterator<P>(&self, prefix: P) -> DBRawIterator<'_>
Creates a prefix iterator with the specified prefix and default read options.
Sourcepub fn raw_iterator(&self) -> DBRawIterator<'_>
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more