pub struct MemWriteTx<'a> { /* private fields */ }Expand description
A single-writer transaction. Holds the write guard (single-writer) and buffers
mutations in overlay; commit applies them to the base map, drop discards.
Trait Implementations§
Source§impl Readable for MemWriteTx<'_>
impl Readable for MemWriteTx<'_>
Source§fn get_raw(&self, table: &str, key: &[u8]) -> StoreResult<Option<Vec<u8>>>
fn get_raw(&self, table: &str, key: &[u8]) -> StoreResult<Option<Vec<u8>>>
Fetch the raw value bytes for
key in table, or None if absent.Source§fn range_raw(
&self,
table: &str,
lo: &[u8],
hi: &[u8],
) -> StoreResult<Vec<(Vec<u8>, Vec<u8>)>>
fn range_raw( &self, table: &str, lo: &[u8], hi: &[u8], ) -> StoreResult<Vec<(Vec<u8>, Vec<u8>)>>
Return
(key, value) byte pairs in the half-open range [lo, hi),
in ascending key (byte-lexicographic) order. Because keys are written in
the order-preserving encoding (see crate::codec), this is logical
key order.Source§impl WriteTx for MemWriteTx<'_>
impl WriteTx for MemWriteTx<'_>
Source§fn put_raw(&mut self, table: &str, key: &[u8], val: &[u8]) -> StoreResult<()>
fn put_raw(&mut self, table: &str, key: &[u8], val: &[u8]) -> StoreResult<()>
Insert or overwrite
key → val in table.Source§fn delete_raw(&mut self, table: &str, key: &[u8]) -> StoreResult<bool>
fn delete_raw(&mut self, table: &str, key: &[u8]) -> StoreResult<bool>
Remove
key from table. Returns true if a value was present.Source§fn commit(self) -> StoreResult<()>
fn commit(self) -> StoreResult<()>
Atomically apply every buffered mutation. Consuming
self makes
“use after commit” a compile error and “drop without commit” the
rollback path.Auto Trait Implementations§
impl<'a> !Send for MemWriteTx<'a>
impl<'a> Freeze for MemWriteTx<'a>
impl<'a> RefUnwindSafe for MemWriteTx<'a>
impl<'a> Sync for MemWriteTx<'a>
impl<'a> Unpin for MemWriteTx<'a>
impl<'a> UnsafeUnpin for MemWriteTx<'a>
impl<'a> UnwindSafe for MemWriteTx<'a>
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