pub trait Transaction: Sized {
    type Error;
    type Handle;

    // Required method
    fn commit(self) -> Result<(), Self::Error>;

    // Provided method
    fn abort(self) { ... }
}
Expand description

A transaction which can be committed or aborted.

Required Associated Types§

source

type Error

An error which can occur while reading or writing during a transaction, or committing the transaction.

source

type Handle

An entity which is being read from or written to during a transaction.

Required Methods§

source

fn commit(self) -> Result<(), Self::Error>

Commits the transaction.

Provided Methods§

source

fn abort(self)

Aborts the transaction.

Any pending operations will not be saved.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<'a> Transaction for RoTransaction<'a>

§

type Error = Error

§

type Handle = Database

source§

fn commit(self) -> Result<(), Self::Error>

source§

impl<'a> Transaction for RwTransaction<'a>

§

type Error = Error

§

type Handle = Database

source§

fn commit(self) -> Result<(), Self::Error>

Implementors§