[][src]Struct qldb::Transaction

pub struct Transaction { /* fields omitted */ }

Every query in QLDB is within a transaction. Ideally you will interact with this object via the method QLDBClient::transaction_within.

Implementations

impl Transaction[src]

pub fn query(&self, statement: &str) -> QueryBuilder[src]

Sends a query to QLDB. It will return an Array of IonValues already decoded. Parameters need to be provided using IonValue.

pub async fn commit<'_>(&'_ self) -> QLDBResult<()>[src]

pub async fn rollback<'_>(&'_ self) -> QLDBResult<()>[src]

Cancels the transaction. Once rollback is called the transaction becomes invalid. Subsequent calls to rollback or commit (internally) won't have any effect.

It fails is the transaction is already committed. For a rollback that doesn't fail when already committed you can check the silent_rollback method.

pub async fn silent_rollback<'_>(&'_ self) -> QLDBResult<()>[src]

Cancels the transaction but it doesn't fails is the transaction was already committed. This is useful for auto-closing scenarios where you just want to rollback always when there is a drop or something similar.

Once rollback is called the transaction becomes invalid. Subsequent calls to rollback or commit (internally) won't have any effect.

Trait Implementations

impl Clone for Transaction[src]

Auto Trait Implementations

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> Instrument for T[src]

impl<T> Instrument 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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.