pub struct TxnState {
pub epoch: u32,
pub action: TxnAction,
pub pending: Vec<TxnOp>,
}Expand description
Shared transaction snapshot. The driver mutates this behind an
Arc<RwLock<_>>; workers clone the inner value each epoch.
Fields§
§epoch: u32Broadcast indicator: incremented on each publish so workers can detect “new txn”.
action: TxnActionBroadcast indicator: what the workers should do for this epoch.
pending: Vec<TxnOp>Updates queued for the next commit.
Implementations§
Source§impl TxnState
impl TxnState
Sourcepub fn clear_pending(&mut self)
pub fn clear_pending(&mut self)
Clear the pending queue — used by drivers when starting or aborting a transaction.
Sourcepub fn as_commit_snapshot(&self, next_epoch: u32) -> TxnState
pub fn as_commit_snapshot(&self, next_epoch: u32) -> TxnState
Snapshot the current state as a Commit broadcast at next_epoch.
Clones pending so the driver can keep its queue for rollback.
Sourcepub fn as_quit_snapshot(next_epoch: u32) -> TxnState
pub fn as_quit_snapshot(next_epoch: u32) -> TxnState
Freestanding Quit snapshot — no carried pending ops.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TxnState
impl RefUnwindSafe for TxnState
impl Send for TxnState
impl Sync for TxnState
impl Unpin for TxnState
impl UnsafeUnpin for TxnState
impl UnwindSafe for TxnState
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<'a, S, T> Semigroup<&'a S> for Twhere
T: Semigroup<S>,
impl<'a, S, T> Semigroup<&'a S> for Twhere
T: Semigroup<S>,
Source§fn plus_equals(&mut self, rhs: &&'a S)
fn plus_equals(&mut self, rhs: &&'a S)
The method of
std::ops::AddAssign, for types that do not implement AddAssign.