Struct ckb_db::transaction::RocksDBTransaction
source · [−]pub struct RocksDBTransaction { /* private fields */ }Expand description
An optimistic transaction database.
Implementations
sourceimpl RocksDBTransaction
impl RocksDBTransaction
sourcepub fn get(&self, col: Col, key: &[u8]) -> Result<Option<DBVector>>
pub fn get(&self, col: Col, key: &[u8]) -> Result<Option<DBVector>>
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<'a>(
&self,
col: Col,
key: &[u8],
snapshot: &RocksDBTransactionSnapshot<'a>
) -> Result<Option<DBVector>>
pub fn get_for_update<'a>(
&self,
col: Col,
key: &[u8],
snapshot: &RocksDBTransactionSnapshot<'a>
) -> 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
sourceimpl DBIterator for RocksDBTransaction
impl DBIterator for RocksDBTransaction
sourcefn 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 interator using the provided IteratorMode and ReadOptions. This is used when you want to iterate over a specific ColumnFamily with a modified ReadOptions Read more
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more