Struct ckb_db::transaction::RocksDBTransaction
source · 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 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