pub struct ParticipantHandler { /* private fields */ }Expand description
Handler for transaction participants with storage integration.
Implementations§
Source§impl ParticipantHandler
impl ParticipantHandler
Sourcepub fn set_validation_callback(&self, callback: ValidationCallback)
pub fn set_validation_callback(&self, callback: ValidationCallback)
Set the validation callback for prepare phase.
Sourcepub fn set_commit_callback(&self, callback: CommitCallback)
pub fn set_commit_callback(&self, callback: CommitCallback)
Set the commit callback for commit phase.
Sourcepub fn set_abort_callback(&self, callback: AbortCallback)
pub fn set_abort_callback(&self, callback: AbortCallback)
Set the abort callback for abort/rollback phase.
Sourcepub fn handle_prepare(
&self,
txn_id: &TransactionId,
operations: Vec<TransactionOperation>,
) -> TwoPhaseMessage
pub fn handle_prepare( &self, txn_id: &TransactionId, operations: Vec<TransactionOperation>, ) -> TwoPhaseMessage
Handle prepare request with full storage integration.
Sourcepub fn handle_prepare_with_validation<F>(
&self,
txn_id: &TransactionId,
operations: Vec<TransactionOperation>,
validator: F,
) -> TwoPhaseMessage
pub fn handle_prepare_with_validation<F>( &self, txn_id: &TransactionId, operations: Vec<TransactionOperation>, validator: F, ) -> TwoPhaseMessage
Handle prepare with validation function.
Sourcepub fn handle_commit(&self, txn_id: &TransactionId) -> TwoPhaseMessage
pub fn handle_commit(&self, txn_id: &TransactionId) -> TwoPhaseMessage
Handle commit request with storage integration.
Sourcepub fn handle_abort(&self, txn_id: &TransactionId) -> TwoPhaseMessage
pub fn handle_abort(&self, txn_id: &TransactionId) -> TwoPhaseMessage
Handle abort request with proper cleanup.
Sourcepub fn get_locked_keys(&self, txn_id: &TransactionId) -> Vec<String>
pub fn get_locked_keys(&self, txn_id: &TransactionId) -> Vec<String>
Get currently locked keys for a transaction.
Sourcepub fn is_key_locked(&self, key: &str) -> Option<TransactionId>
pub fn is_key_locked(&self, key: &str) -> Option<TransactionId>
Check if a key is locked by any transaction.
Sourcepub fn is_prepared(&self, txn_id: &TransactionId) -> bool
pub fn is_prepared(&self, txn_id: &TransactionId) -> bool
Check if a transaction is prepared.
Sourcepub fn is_committed(&self, txn_id: &TransactionId) -> bool
pub fn is_committed(&self, txn_id: &TransactionId) -> bool
Check if a transaction is committed.
Sourcepub fn pending_count(&self) -> usize
pub fn pending_count(&self) -> usize
Get pending prepare count.
Auto Trait Implementations§
impl !Freeze for ParticipantHandler
impl RefUnwindSafe for ParticipantHandler
impl Send for ParticipantHandler
impl Sync for ParticipantHandler
impl Unpin for ParticipantHandler
impl UnsafeUnpin for ParticipantHandler
impl UnwindSafe for ParticipantHandler
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