pub struct Transaction {
pub id: TransactionId,
pub state: TransactionState,
pub isolation_level: IsolationLevel,
pub start_timestamp: u64,
pub commit_timestamp: Option<u64>,
pub snapshot: Snapshot,
pub write_set: HashSet<VersionKey>,
pub read_set: HashSet<VersionKey>,
pub locks_held: Vec<LockRequest>,
pub started_at: Instant,
}Expand description
A database transaction with MVCC support.
Fields§
§id: TransactionId§state: TransactionState§isolation_level: IsolationLevel§start_timestamp: u64§commit_timestamp: Option<u64>§snapshot: Snapshot§write_set: HashSet<VersionKey>§read_set: HashSet<VersionKey>§locks_held: Vec<LockRequest>§started_at: InstantImplementations§
Source§impl Transaction
impl Transaction
pub fn new( id: TransactionId, isolation_level: IsolationLevel, start_timestamp: u64, active_transactions: HashSet<TransactionId>, ) -> Self
pub fn is_active(&self) -> bool
pub fn duration(&self) -> Duration
pub fn add_to_write_set(&mut self, key: VersionKey)
pub fn add_to_read_set(&mut self, key: VersionKey)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Transaction
impl RefUnwindSafe for Transaction
impl Send for Transaction
impl Sync for Transaction
impl Unpin for Transaction
impl UnsafeUnpin for Transaction
impl UnwindSafe for Transaction
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