pub struct Transaction {
pub txn_id: u64,
/* private fields */
}Expand description
A database transaction with MVCC support
Fields§
§txn_id: u64Transaction ID
Implementations§
Source§impl Transaction
impl Transaction
Sourcepub fn get(&self, key: &[u8]) -> Result<Option<Vec<u8>>, Error>
pub fn get(&self, key: &[u8]) -> Result<Option<Vec<u8>>, Error>
Read a value with snapshot isolation
Sourcepub fn put(&mut self, key: Vec<u8>, value: Vec<u8>) -> Result<(), Error>
pub fn put(&mut self, key: Vec<u8>, value: Vec<u8>) -> Result<(), Error>
Write a value (buffered until commit)
Sourcepub fn scan(&self, prefix: &[u8]) -> Result<Vec<(Vec<u8>, Vec<u8>)>, Error>
pub fn scan(&self, prefix: &[u8]) -> Result<Vec<(Vec<u8>, Vec<u8>)>, Error>
Scan keys with prefix
Sourcepub fn isolation_level(&self) -> IsolationLevel
pub fn isolation_level(&self) -> IsolationLevel
Get isolation level
Auto Trait Implementations§
impl !Freeze for Transaction
impl RefUnwindSafe for Transaction
impl Send for Transaction
impl Sync for Transaction
impl Unpin for Transaction
impl UnwindSafe for Transaction
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