pub struct TransactionManager { /* private fields */ }Expand description
Managing active transactions and cleanup.
Implementations§
Source§impl TransactionManager
impl TransactionManager
pub fn new() -> Self
Sourcepub fn begin_transaction(&self) -> u64
pub fn begin_transaction(&self) -> u64
Start a new transaction, allocating a read timestamp.
Sourcepub fn allocate_commit_ts(&self) -> u64
pub fn allocate_commit_ts(&self) -> u64
Allocate a commit timestamp.
Sourcepub fn current_ts(&self) -> u64
pub fn current_ts(&self) -> u64
Read the current max timestamp (for non-transactional reads).
Sourcepub fn end_transaction(&self, tx_id: u64)
pub fn end_transaction(&self, tx_id: u64)
Mark a transaction as completed (committed or rolled back).
Sourcepub fn min_active_ts(&self) -> Option<u64>
pub fn min_active_ts(&self) -> Option<u64>
Get the minimum active read timestamp.
This is the watermark below which versions can be safely garbage collected. Returns None if there are no active transactions.
Sourcepub fn active_count(&self) -> usize
pub fn active_count(&self) -> usize
Get the number of active transactions.
Trait Implementations§
Source§impl Debug for TransactionManager
impl Debug for TransactionManager
Auto Trait Implementations§
impl Freeze for TransactionManager
impl !RefUnwindSafe for TransactionManager
impl Send for TransactionManager
impl Sync for TransactionManager
impl Unpin for TransactionManager
impl UnsafeUnpin for TransactionManager
impl !UnwindSafe for TransactionManager
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 more