Trait cuprate_database::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§