pub struct Txn { /* private fields */ }Expand description
A set of writes that become visible all at once, or not at all.
A transaction reads the branch head once, when it is opened, and stages its
writes privately. Txn::commit swaps the branch head to a new commit in
one step, and fails with Error::Conflict if another writer moved the
head meanwhile; the caller then retries. Dropping a transaction without
committing is a rollback that leaves no commit, no head movement and no
change to any sequence counter.
Implementations§
Source§impl Txn
impl Txn
Sourcepub fn get(&self, key: &str) -> Option<Arc<Entry>>
pub fn get(&self, key: &str) -> Option<Arc<Entry>>
Read a key as this transaction sees it: staged writes first, then the branch as it stood when the transaction was opened.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Txn
impl !UnwindSafe for Txn
impl Freeze for Txn
impl Send for Txn
impl Sync for Txn
impl Unpin for Txn
impl UnsafeUnpin for Txn
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