pub struct RedbWriteTx { /* private fields */ }Expand description
A redb write transaction. redb buffers mutations and applies them atomically
on commit; dropping without committing aborts (rollback).
Trait Implementations§
Source§impl Readable for RedbWriteTx
impl Readable for RedbWriteTx
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 RedbWriteTx
impl WriteTx for RedbWriteTx
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 !Freeze for RedbWriteTx
impl !RefUnwindSafe for RedbWriteTx
impl !UnwindSafe for RedbWriteTx
impl Send for RedbWriteTx
impl Sync for RedbWriteTx
impl Unpin for RedbWriteTx
impl UnsafeUnpin for RedbWriteTx
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