pub struct TransactionManager { /* private fields */ }Expand description
Transaction manager combining execution, persistence, and validation
Implementations§
Source§impl TransactionManager
impl TransactionManager
Sourcepub fn new(node_id: String, initial_version: StateVersion) -> Self
pub fn new(node_id: String, initial_version: StateVersion) -> Self
Create a new transaction manager
Sourcepub fn current_state_version(&self) -> StateVersion
pub fn current_state_version(&self) -> StateVersion
Get the current state version
Sourcepub fn execute_and_commit(
&mut self,
transaction_id: String,
operations: Vec<Operation>,
consistency_contract: ConsistencyContract,
) -> TxResult<StateTransitionRecord>
pub fn execute_and_commit( &mut self, transaction_id: String, operations: Vec<Operation>, consistency_contract: ConsistencyContract, ) -> TxResult<StateTransitionRecord>
Execute a transaction with full persistence integration
Sourcepub fn get_operation(
&self,
operation_id: &OperationId,
) -> Option<OperationLogEntry>
pub fn get_operation( &self, operation_id: &OperationId, ) -> Option<OperationLogEntry>
Get a recorded operation by ID
Sourcepub fn get_transition(
&self,
transaction_id: &str,
) -> Option<StateTransitionRecord>
pub fn get_transition( &self, transaction_id: &str, ) -> Option<StateTransitionRecord>
Get a recorded transition by transaction ID
Sourcepub fn operation_log_size(&self) -> u64
pub fn operation_log_size(&self) -> u64
Get the operation log size
Sourcepub fn transition_store_size(&self) -> u64
pub fn transition_store_size(&self) -> u64
Get the transition store size
Sourcepub fn rebuild_from_operation_log(&mut self) -> TxResult<StateVersion>
pub fn rebuild_from_operation_log(&mut self) -> TxResult<StateVersion>
Rebuild state from operation log (for recovery) Executes all operations in order to verify state integrity
Sourcepub fn get_transition_chain_from(
&self,
from_state_hash: &str,
) -> Vec<StateTransitionRecord>
pub fn get_transition_chain_from( &self, from_state_hash: &str, ) -> Vec<StateTransitionRecord>
Get the chain of state transitions from a starting version
Sourcepub fn validate_preconditions(&self, operation: &Operation) -> TxResult<()>
pub fn validate_preconditions(&self, operation: &Operation) -> TxResult<()>
Validate preconditions for an operation (Simple string matching - production would have actual condition evaluation)
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