pub struct TransactionManager { /* private fields */ }Expand description
Transaction manager
Implementations§
Source§impl TransactionManager
impl TransactionManager
Sourcepub fn new(config: TxnConfig) -> TransactionManager
pub fn new(config: TxnConfig) -> TransactionManager
Create new transaction manager
Sourcepub fn with_default_config() -> TransactionManager
pub fn with_default_config() -> TransactionManager
Create with default config
Sourcepub fn begin_with_isolation(&self, isolation: IsolationLevel) -> TxnHandle
pub fn begin_with_isolation(&self, isolation: IsolationLevel) -> TxnHandle
Begin transaction with specific isolation level
Sourcepub fn begin_transaction(self: &Arc<TransactionManager>) -> Transaction
pub fn begin_transaction(self: &Arc<TransactionManager>) -> Transaction
Begin with Transaction wrapper
Sourcepub fn record_read(&self, txn_id: u64, key: &[u8], read_ts: u64)
pub fn record_read(&self, txn_id: u64, key: &[u8], read_ts: u64)
Record a read operation
Sourcepub fn record_write(
&self,
txn_id: u64,
key: &[u8],
old_value: Option<&[u8]>,
new_value: Option<&[u8]>,
)
pub fn record_write( &self, txn_id: u64, key: &[u8], old_value: Option<&[u8]>, new_value: Option<&[u8]>, )
Record a write operation
Sourcepub fn acquire_lock(
&self,
txn_id: u64,
key: &[u8],
mode: LockMode,
) -> Result<(), TxnError>
pub fn acquire_lock( &self, txn_id: u64, key: &[u8], mode: LockMode, ) -> Result<(), TxnError>
Acquire lock for key
Sourcepub fn create_savepoint(&self, txn_id: u64, name: &str) -> Result<(), TxnError>
pub fn create_savepoint(&self, txn_id: u64, name: &str) -> Result<(), TxnError>
Create savepoint
Sourcepub fn rollback_to_savepoint(
&self,
txn_id: u64,
name: &str,
) -> Result<(), TxnError>
pub fn rollback_to_savepoint( &self, txn_id: u64, name: &str, ) -> Result<(), TxnError>
Rollback to savepoint
Sourcepub fn active_count(&self) -> usize
pub fn active_count(&self) -> usize
Get active transaction count
Sourcepub fn oldest_active_ts(&self) -> Option<u64>
pub fn oldest_active_ts(&self) -> Option<u64>
Get oldest active transaction timestamp
Trait Implementations§
Source§impl Default for TransactionManager
impl Default for TransactionManager
Source§fn default() -> TransactionManager
fn default() -> TransactionManager
Returns the “default value” for a type. Read more
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request