[][src]Struct sqlx_core::transaction::Transaction

pub struct Transaction<'c, DB> where
    DB: Database
{ /* fields omitted */ }

An in-progress database transaction or savepoint.

A transaction starts with a call to Pool::begin or Connection::begin.

A transaction should end with a call to commit or rollback. If neither are called before the transaction goes out-of-scope, rollback is called. In other words, rollback is called on drop if the transaction is still in-progress.

A savepoint is a special mark inside a transaction that allows all commands that are executed after it was established to be rolled back, restoring the transaction state to what it was at the time of the savepoint.

Implementations

impl<'c, DB> Transaction<'c, DB> where
    DB: Database
[src]

pub async fn commit(__arg0: Self) -> Result<(), Error>[src]

Commits this transaction or savepoint.

pub async fn rollback(__arg0: Self) -> Result<(), Error>[src]

Aborts this transaction or savepoint.

Trait Implementations

impl<'c, DB> Debug for Transaction<'c, DB> where
    DB: Database
[src]

impl<'c, DB> Deref for Transaction<'c, DB> where
    DB: Database
[src]

type Target = DB::Connection

The resulting type after dereferencing.

impl<'c, DB> DerefMut for Transaction<'c, DB> where
    DB: Database
[src]

impl<'c, DB> Drop for Transaction<'c, DB> where
    DB: Database
[src]

Auto Trait Implementations

impl<'c, DB> !RefUnwindSafe for Transaction<'c, DB>

impl<'c, DB> Send for Transaction<'c, DB> where
    <DB as Database>::Connection: Send,
    <<DB as Database>::Connection as Connection>::Options: Send + Sync

impl<'c, DB> Sync for Transaction<'c, DB> where
    <DB as Database>::Connection: Send + Sync,
    <<DB as Database>::Connection as Connection>::Options: Send + Sync

impl<'c, DB> Unpin for Transaction<'c, DB> where
    <DB as Database>::Connection: Unpin

impl<'c, DB> !UnwindSafe for Transaction<'c, DB>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.