pub struct RocksDBTransaction { /* private fields */ }
Expand description
An optimistic transaction database.
Implementations§
Source§impl RocksDBTransaction
impl RocksDBTransaction
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 bytes associated with the given key and given column.
Sourcepub fn put(&self, col: Col, key: &[u8], value: &[u8]) -> Result<()>
pub fn put(&self, col: Col, key: &[u8], value: &[u8]) -> Result<()>
Write the bytes into the given column with associated key.
Sourcepub fn delete(&self, col: Col, key: &[u8]) -> Result<()>
pub fn delete(&self, col: Col, key: &[u8]) -> Result<()>
Delete the data associated with the given key and given column.
Sourcepub fn get_for_update(
&self,
col: Col,
key: &[u8],
snapshot: &RocksDBTransactionSnapshot<'_>,
) -> Result<Option<DBVector>>
pub fn get_for_update( &self, col: Col, key: &[u8], snapshot: &RocksDBTransactionSnapshot<'_>, ) -> Result<Option<DBVector>>
Read a key and make the read value a precondition for transaction commit.
Sourcepub fn get_snapshot(&self) -> RocksDBTransactionSnapshot<'_>
pub fn get_snapshot(&self) -> RocksDBTransactionSnapshot<'_>
Return RocksDBTransactionSnapshot
Sourcepub fn set_savepoint(&self)
pub fn set_savepoint(&self)
Set savepoint for transaction.
Sourcepub fn rollback_to_savepoint(&self) -> Result<()>
pub fn rollback_to_savepoint(&self) -> Result<()>
Rollback the transaction to savepoint.
Trait Implementations§
Source§impl DBIterator for RocksDBTransaction
impl DBIterator for RocksDBTransaction
Source§fn iter_opt(
&self,
col: Col,
mode: IteratorMode<'_>,
readopts: &ReadOptions,
) -> Result<DBIter<'_>>
fn iter_opt( &self, col: Col, mode: IteratorMode<'_>, readopts: &ReadOptions, ) -> Result<DBIter<'_>>
Opens an iterator using the provided IteratorMode and ReadOptions.
This is used when you want to iterate over a specific ColumnFamily with a modified ReadOptions
Auto Trait Implementations§
impl Freeze for RocksDBTransaction
impl RefUnwindSafe for RocksDBTransaction
impl Send for RocksDBTransaction
impl Sync for RocksDBTransaction
impl Unpin for RocksDBTransaction
impl UnwindSafe for RocksDBTransaction
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more