TransactionOps

Trait TransactionOps 

Source
pub trait TransactionOps: Sized + Send {
    type Error: Error + Send + Sync;

    // Required methods
    async fn commit(self) -> Result<(), Self::Error>;
    async fn rollback(self) -> Result<(), Self::Error>;
}
Expand description

Trait for transaction types that can be committed or rolled back.

Required Associated Types§

Source

type Error: Error + Send + Sync

Error type.

Required Methods§

Source

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

Commit the transaction.

Source

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

Rollback the transaction.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl TransactionOps for Transaction<'_, Postgres>

Implementors§