Enum mz_coord::session::TransactionStatus
source · [−]pub enum TransactionStatus<T> {
Default,
Started(Transaction<T>),
InTransaction(Transaction<T>),
InTransactionImplicit(Transaction<T>),
Failed(Transaction<T>),
}
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<T>)
Running a single-query transaction. Matches TBLOCK_STARTED
.
InTransaction(Transaction<T>)
Currently in a transaction issued from a BEGIN
. Matches TBLOCK_INPROGRESS
.
InTransactionImplicit(Transaction<T>)
Currently in an implicit transaction started from a multi-statement query
with more than 1 statements. Matches TBLOCK_IMPLICIT_INPROGRESS
.
Failed(Transaction<T>)
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
sourceimpl<T> TransactionStatus<T>
impl<T> TransactionStatus<T>
sourcepub fn into_ops_and_lock_guard(
self
) -> (Option<TransactionOps<T>>, Option<OwnedMutexGuard<()>>)
pub fn into_ops_and_lock_guard(
self
) -> (Option<TransactionOps<T>>, Option<OwnedMutexGuard<()>>)
Extracts the inner transaction ops and write lock guard if not failed.
sourcepub fn inner(&self) -> Option<&Transaction<T>>
pub fn inner(&self) -> Option<&Transaction<T>>
Exposes the inner transaction.
sourcepub fn inner_mut(&mut self) -> Option<&mut Transaction<T>>
pub fn inner_mut(&mut self) -> Option<&mut Transaction<T>>
Exposes the inner transaction.
sourcepub fn is_implicit(&self) -> bool
pub fn is_implicit(&self) -> bool
Expresses whether or not the transaction was implicitly started. However, its negation does not imply explicitly started.
sourcepub fn grant_write_lock(&mut self, guard: OwnedMutexGuard<()>)
pub fn grant_write_lock(&mut self, guard: OwnedMutexGuard<()>)
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
sourceimpl<T: Debug> Debug for TransactionStatus<T>
impl<T: Debug> Debug for TransactionStatus<T>
Auto Trait Implementations
impl<T> !RefUnwindSafe for TransactionStatus<T>
impl<T> Send for TransactionStatus<T> where
T: Send,
impl<T> Sync for TransactionStatus<T> where
T: Sync,
impl<T> Unpin for TransactionStatus<T> where
T: Unpin,
impl<T> !UnwindSafe for TransactionStatus<T>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> FutureExt for T
impl<T> FutureExt for T
sourcefn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
sourcefn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
sourcefn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message T
in a tonic::Request
sourceimpl<P, R> ProtoType<R> for P where
R: RustType<P>,
impl<P, R> ProtoType<R> for P where
R: RustType<P>,
sourcefn into_rust(self) -> Result<R, TryFromProtoError>
fn into_rust(self) -> Result<R, TryFromProtoError>
See RustType::from_proto
.
sourcefn from_rust(rust: &R) -> P
fn from_rust(rust: &R) -> P
See RustType::into_proto
.
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more