Skip to main content

TransactionState

Struct TransactionState 

Source
pub struct TransactionState { /* private fields */ }
Expand description

Volatile connection state for a host transaction dispatcher.

The host serializes lifecycle calls per connection and validates transaction control before calling this layer. Commit preparation supplies write-conflict validation and durable publication; this state machine performs neither I/O nor recovery, and its visibility transitions alone do not acknowledge a write.

Implementations§

Source§

impl TransactionState

Source

pub fn new() -> Self

Source

pub fn begin(&self, connection_id: u64, isolation: IsolationLevel) -> Xid

Source

pub fn commit<E, Publication>( &self, connection_id: u64, prepare: impl FnOnce(&TxnContext) -> Result<Publication, E>, ) -> Result<Option<TxnContext>, E>

Source

pub fn rollback(&self, connection_id: u64) -> Option<TxnContext>

Source

pub fn has_savepoint(&self, connection_id: u64, name: &str) -> bool

Source

pub fn savepoint(&self, connection_id: u64, name: &str) -> Option<Xid>

Source

pub fn release_savepoint( &self, connection_id: u64, name: &str, ) -> Result<Option<usize>, SavepointError>

Source

pub fn rollback_to_savepoint( &self, connection_id: u64, name: &str, ) -> Result<Option<RollbackToSavepoint>, SavepointError>

Source

pub fn context(&self, connection_id: u64) -> Option<TxnContext>

Source

pub fn in_transaction(&self, connection_id: u64) -> bool

Source

pub fn current_snapshot(&self, connection_id: u64) -> Snapshot

Source

pub fn retained_current_snapshot( &self, connection_id: u64, ) -> (Snapshot, SnapshotRetentionGuard)

Source

pub fn writer_xid(&self, connection_id: u64) -> Option<Xid>

Source

pub fn own_xids(&self, connection_id: u64) -> HashSet<Xid>

Source

pub fn set_local_tenant(&self, connection_id: u64, tenant: Option<String>)

Source

pub fn local_tenant(&self, connection_id: u64) -> Option<Option<String>>

Source

pub fn snapshot_manager(&self) -> Arc<SnapshotManager> ⓘ

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

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> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.