pub enum TransactionManagerStatus {
Valid(ValidTransactionManagerStatus),
InError,
}
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
impl TransactionManagerStatus
sourcepub fn transaction_depth(&self) -> QueryResult<Option<NonZeroU32>>
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.
sourcepub fn is_not_broken_and_in_transaction(&self) -> bool
👎Deprecated: Removed without replacement
pub fn is_not_broken_and_in_transaction(&self) -> bool
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
sourcepub fn set_top_level_transaction_requires_rollback(&mut self)
👎Deprecated: Use set_requires_rollback_maybe_up_to_top_level
instead
pub fn set_top_level_transaction_requires_rollback(&mut self)
set_requires_rollback_maybe_up_to_top_level
insteadIf in transaction and transaction manager is not broken, registers that the connection can not be used anymore until top-level transaction is rolled back
sourcepub fn set_requires_rollback_maybe_up_to_top_level(&mut self, to: bool)
pub fn set_requires_rollback_maybe_up_to_top_level(&mut self, to: bool)
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.)
sourcepub fn set_in_error(&mut self)
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
impl Debug for TransactionManagerStatus
Auto Trait Implementations§
impl RefUnwindSafe for TransactionManagerStatus
impl Send for TransactionManagerStatus
impl Sync for TransactionManagerStatus
impl Unpin for TransactionManagerStatus
impl UnwindSafe for TransactionManagerStatus
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> IntoSql for T
impl<T> IntoSql for T
source§fn into_sql<T>(self) -> AsExprOf<Self, T>where
Self: AsExpression<T> + Sized,
T: SqlType + TypedExpressionType,
fn into_sql<T>(self) -> AsExprOf<Self, T>where Self: AsExpression<T> + Sized, T: SqlType + TypedExpressionType,
self
to an expression for Diesel’s query builder. Read moresource§fn as_sql<'a, T>(&'a self) -> AsExprOf<&'a Self, T>where
&'a Self: AsExpression<T>,
T: SqlType + TypedExpressionType,
fn as_sql<'a, T>(&'a self) -> AsExprOf<&'a Self, T>where &'a Self: AsExpression<T>, T: SqlType + TypedExpressionType,
&self
to an expression for Diesel’s query builder. Read more