pub struct TransactionManager;Expand description
Manages persisted KV transactions for CLI usage.
Implementations§
Source§impl TransactionManager
impl TransactionManager
Sourcepub fn begin_with_timeout(db: &Database, timeout: Duration) -> Result<String>
pub fn begin_with_timeout(db: &Database, timeout: Duration) -> Result<String>
Begins a new transaction with the given timeout and returns its ID.
Sourcepub fn get_info(db: &Database, txn_id: &str) -> Result<TransactionInfo>
pub fn get_info(db: &Database, txn_id: &str) -> Result<TransactionInfo>
Retrieves persisted transaction metadata.
Sourcepub fn is_expired(db: &Database, txn_id: &str) -> Result<bool>
pub fn is_expired(db: &Database, txn_id: &str) -> Result<bool>
Checks whether a transaction has expired.
Sourcepub fn get(db: &Database, txn_id: &str, key: &[u8]) -> Result<Option<Vec<u8>>>
pub fn get(db: &Database, txn_id: &str, key: &[u8]) -> Result<Option<Vec<u8>>>
Retrieves a key within the specified transaction.
Sourcepub fn put(db: &Database, txn_id: &str, key: &[u8], value: &[u8]) -> Result<()>
pub fn put(db: &Database, txn_id: &str, key: &[u8], value: &[u8]) -> Result<()>
Stages a put operation within the specified transaction.
Sourcepub fn delete(db: &Database, txn_id: &str, key: &[u8]) -> Result<()>
pub fn delete(db: &Database, txn_id: &str, key: &[u8]) -> Result<()>
Stages a delete operation within the specified transaction.
Auto Trait Implementations§
impl Freeze for TransactionManager
impl RefUnwindSafe for TransactionManager
impl Send for TransactionManager
impl Sync for TransactionManager
impl Unpin for TransactionManager
impl UnwindSafe for TransactionManager
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