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
impl TransactionState
pub fn new() -> Self
pub fn begin(&self, connection_id: u64, isolation: IsolationLevel) -> Xid
pub fn commit<E, Publication>( &self, connection_id: u64, prepare: impl FnOnce(&TxnContext) -> Result<Publication, E>, ) -> Result<Option<TxnContext>, E>
pub fn rollback(&self, connection_id: u64) -> Option<TxnContext>
pub fn has_savepoint(&self, connection_id: u64, name: &str) -> bool
pub fn savepoint(&self, connection_id: u64, name: &str) -> Option<Xid>
pub fn release_savepoint( &self, connection_id: u64, name: &str, ) -> Result<Option<usize>, SavepointError>
pub fn rollback_to_savepoint( &self, connection_id: u64, name: &str, ) -> Result<Option<RollbackToSavepoint>, SavepointError>
pub fn context(&self, connection_id: u64) -> Option<TxnContext>
pub fn in_transaction(&self, connection_id: u64) -> bool
pub fn current_snapshot(&self, connection_id: u64) -> Snapshot
pub fn retained_current_snapshot( &self, connection_id: u64, ) -> (Snapshot, SnapshotRetentionGuard)
pub fn writer_xid(&self, connection_id: u64) -> Option<Xid>
pub fn own_xids(&self, connection_id: u64) -> HashSet<Xid>
pub fn set_local_tenant(&self, connection_id: u64, tenant: Option<String>)
pub fn local_tenant(&self, connection_id: u64) -> Option<Option<String>>
pub fn snapshot_manager(&self) -> Arc<SnapshotManager> ⓘ
Auto Trait Implementations§
impl !Freeze for TransactionState
impl !RefUnwindSafe for TransactionState
impl !UnwindSafe for TransactionState
impl Send for TransactionState
impl Sync for TransactionState
impl Unpin for TransactionState
impl UnsafeUnpin for TransactionState
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
Mutably borrows from an owned value. Read more