cuprate_database

Trait TxRw

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

Read/write database transaction.

Returned from EnvInner::tx_rw.

Required Methods§

Source

fn commit(self) -> DbResult<()>

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, crate::RuntimeError::ResizeNeeded may be returned.

Source

fn abort(self) -> DbResult<()>

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

This function is infallible.

Source§

fn commit(self) -> DbResult<()>

Implementors§