Skip to main content

WriteTx

Trait WriteTx 

Source
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§

Source

fn put_raw(&mut self, table: &str, key: &[u8], val: &[u8]) -> StoreResult<()>

Insert or overwrite keyval in table.

Source

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<()>

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".

Implementors§