pub trait WriteTx: Readable {
// Required methods
fn put_raw(
&mut self,
table: &str,
key: &[u8],
val: &[u8],
) -> StoreResult<()>;
fn delete_raw(&mut self, table: &str, key: &[u8]) -> StoreResult<bool>;
fn commit(self) -> StoreResult<()>;
}Expand description
A single-writer transaction. Mutations are buffered and applied atomically on
commit; dropping without committing rolls back.
Required Methods§
Sourcefn 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.
Sourcefn 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.
Sourcefn 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.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".