Enum coord::session::TransactionStatus [−][src]
pub enum TransactionStatus {
Default,
Started(Transaction),
InTransaction(Transaction),
InTransactionImplicit(Transaction),
Failed(Transaction),
}
Expand description
The transaction status of a session.
PostgreSQL’s transaction states are in backend/access/transam/xact.c.
Variants
Default
Idle. Matches TBLOCK_DEFAULT
.
Started(Transaction)
Tuple Fields
0: Transaction
Running a single-query transaction. Matches TBLOCK_STARTED
.
InTransaction(Transaction)
Tuple Fields
0: Transaction
Currently in a transaction issued from a BEGIN
. Matches TBLOCK_INPROGRESS
.
InTransactionImplicit(Transaction)
Tuple Fields
0: Transaction
Currently in an implicit transaction started from a multi-statement query
with more than 1 statements. Matches TBLOCK_IMPLICIT_INPROGRESS
.
Failed(Transaction)
Tuple Fields
0: Transaction
In a failed transaction that was started explicitly (i.e., previously
InTransaction). We do not use Failed for implicit transactions because
those cleanup after themselves. Matches TBLOCK_ABORT
.
Implementations
Extracts the inner transaction ops if not failed.
Exposes the inner transaction.
Exposes the inner transaction.
Expresses whether or not the transaction was implicitly started. However, its negation does not imply explicitly started.
Grants the write lock to the inner transaction.
Panics
If self
is TransactionStatus::Default
, which indicates that the
transaction is idle, which is not appropriate to assign the
coordinator’s write lock to.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for TransactionStatus
impl Send for TransactionStatus
impl Sync for TransactionStatus
impl Unpin for TransactionStatus
impl !UnwindSafe for TransactionStatus
Blanket Implementations
Mutably borrows from an owned value. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more