cuprate_database

Trait TxRw

Source
pub trait TxRw<'tx> {
    // Required methods
    fn commit(self) -> Result<(), RuntimeError>;
    fn abort(self) -> Result<(), RuntimeError>;
}
Expand description

Read/write database transaction.

Returned from EnvInner::tx_rw.

Required Methods§

Source

fn commit(self) -> Result<(), RuntimeError>

Commit the read/write transaction.

Note that this doesn’t necessarily sync the database caches to disk.

§Errors

This operation will always return Ok(()) with the redb backend.

If Env::MANUAL_RESIZE == true, RuntimeError::ResizeNeeded may be returned.

Source

fn abort(self) -> Result<(), RuntimeError>

Abort the transaction, erasing any writes that have occurred.

§Errors

This operation will always return Ok(()) with the heed backend.

Implementations on Foreign Types§

Source§

impl TxRw<'_> for RefCell<RwTxn<'_>>

Source§

fn abort(self) -> Result<(), RuntimeError>

This function is infallible.

Source§

fn commit(self) -> Result<(), RuntimeError>

Implementors§