pub struct TransactionSession { /* private fields */ }Expand description
Stores active transactions and their owner identities.
Implementations§
Source§impl TransactionSession
impl TransactionSession
Sourcepub fn begin_transaction(&mut self, owner: Vec<u8>) -> TransactionId
pub fn begin_transaction(&mut self, owner: Vec<u8>) -> TransactionId
Begins a new transaction for the given owner identity and returns its ID.
Sourcepub fn has_transaction(
&self,
transaction_id: &TransactionId,
caller: &[u8],
) -> bool
pub fn has_transaction( &self, transaction_id: &TransactionId, caller: &[u8], ) -> bool
Checks whether a transaction exists and is owned by the given identity.
Sourcepub fn get_transaction(
&self,
transaction_id: &TransactionId,
) -> DbmsResult<&Transaction>
pub fn get_transaction( &self, transaction_id: &TransactionId, ) -> DbmsResult<&Transaction>
Retrieves a shared reference to the transaction.
Sourcepub fn take_transaction(
&mut self,
transaction_id: &TransactionId,
) -> DbmsResult<Transaction>
pub fn take_transaction( &mut self, transaction_id: &TransactionId, ) -> DbmsResult<Transaction>
Removes and returns the transaction (used during commit).
Sourcepub fn close_transaction(&mut self, transaction_id: &TransactionId)
pub fn close_transaction(&mut self, transaction_id: &TransactionId)
Closes (discards) the transaction without returning it.
Sourcepub fn get_transaction_mut(
&mut self,
transaction_id: &TransactionId,
) -> DbmsResult<&mut Transaction>
pub fn get_transaction_mut( &mut self, transaction_id: &TransactionId, ) -> DbmsResult<&mut Transaction>
Retrieves a mutable reference to the transaction.
Trait Implementations§
Source§impl Debug for TransactionSession
impl Debug for TransactionSession
Source§impl Default for TransactionSession
impl Default for TransactionSession
Source§fn default() -> TransactionSession
fn default() -> TransactionSession
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for TransactionSession
impl RefUnwindSafe for TransactionSession
impl Send for TransactionSession
impl Sync for TransactionSession
impl Unpin for TransactionSession
impl UnsafeUnpin for TransactionSession
impl UnwindSafe for TransactionSession
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