pub enum TransactionManagerStatus {
    Valid(ValidTransactionManagerStatus),
    InError,
}
Available on crate feature i-implement-a-third-party-backend-and-opt-into-breaking-changes only.
Expand description

Status of the transaction manager

Variants§

§

Valid(ValidTransactionManagerStatus)

Valid status, the manager can run operations

§

InError

Error status, probably following a broken connection. The manager will no longer run operations

Implementations§

source§

impl TransactionManagerStatus

source

pub fn transaction_depth(&self) -> QueryResult<Option<NonZeroU32>>

Returns the transaction depth if the transaction manager’s status is valid, or returns Error::BrokenTransactionManager if the transaction manager is in error.

source

pub fn is_not_broken_and_in_transaction(&self) -> bool

👎Deprecated: Removed without replacement

Whether we may be interested in calling set_top_level_transaction_requires_rollback_if_not_broken

You should typically not need this outside of a custom backend implementation

source

pub fn set_top_level_transaction_requires_rollback(&mut self)

👎Deprecated: Use set_requires_rollback_maybe_up_to_top_level instead

If in transaction and transaction manager is not broken, registers that the connection can not be used anymore until top-level transaction is rolled back

source

pub fn set_requires_rollback_maybe_up_to_top_level(&mut self, to: bool)

Available on crate features i-implement-a-third-party-backend-and-opt-into-breaking-changes or postgres or mysql only.

If in transaction and transaction manager is not broken, registers that it’s possible that the connection can not be used anymore until top-level transaction is rolled back.

If that is registered, savepoints rollbacks will still be attempted, but failure to do so will not result in an error. (Some may succeed, some may not.)

source

pub fn set_in_error(&mut self)

Sets the transaction manager status to InError

Subsequent attempts to use transaction-related features will result in a Error::BrokenTransactionManager error

Trait Implementations§

source§

impl Debug for TransactionManagerStatus

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for TransactionManagerStatus

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoSql for T

source§

fn into_sql<T>(self) -> AsExprOf<Self, T>where Self: AsExpression<T> + Sized, T: SqlType + TypedExpressionType,

Convert self to an expression for Diesel’s query builder. Read more
source§

fn as_sql<'a, T>(&'a self) -> AsExprOf<&'a Self, T>where &'a Self: AsExpression<T>, T: SqlType + TypedExpressionType,

Convert &self to an expression for Diesel’s query builder. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

source§

fn vzip(self) -> V