pub struct BankingSMR { /* private fields */ }Expand description
Banking state machine implementation
Implementations§
Source§impl BankingSMR
impl BankingSMR
Sourcepub fn account_count(&self) -> usize
pub fn account_count(&self) -> usize
Get the total number of accounts
Sourcepub fn transaction_count(&self) -> usize
pub fn transaction_count(&self) -> usize
Get the total number of transactions
Sourcepub fn operation_count(&self) -> u64
pub fn operation_count(&self) -> u64
Get the total number of operations performed
Sourcepub fn total_value(&self) -> i64
pub fn total_value(&self) -> i64
Get total value across all accounts
Trait Implementations§
Source§impl Clone for BankingSMR
impl Clone for BankingSMR
Source§fn clone(&self) -> BankingSMR
fn clone(&self) -> BankingSMR
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BankingSMR
impl Debug for BankingSMR
Source§impl Default for BankingSMR
impl Default for BankingSMR
Source§impl StateMachine for BankingSMR
impl StateMachine for BankingSMR
Source§type Command = BankingCommand
type Command = BankingCommand
The command type that this state machine can process
Source§type Response = BankingResponse
type Response = BankingResponse
The response type returned after applying commands
Source§type State = BankingState
type State = BankingState
The state type representing the current state of the machine
Source§fn apply_command<'life0, 'async_trait>(
&'life0 mut self,
command: Self::Command,
) -> Pin<Box<dyn Future<Output = Self::Response> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn apply_command<'life0, 'async_trait>(
&'life0 mut self,
command: Self::Command,
) -> Pin<Box<dyn Future<Output = Self::Response> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Apply a single command to the state machine. Read more
Source§fn deserialize_state(&mut self, data: &[u8]) -> Result<(), Box<dyn Error>>
fn deserialize_state(&mut self, data: &[u8]) -> Result<(), Box<dyn Error>>
Deserialize state from bytes and restore it. Read more
Source§fn apply_commands<'life0, 'async_trait>(
&'life0 mut self,
commands: Vec<Self::Command>,
) -> Pin<Box<dyn Future<Output = Vec<Self::Response>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn apply_commands<'life0, 'async_trait>(
&'life0 mut self,
commands: Vec<Self::Command>,
) -> Pin<Box<dyn Future<Output = Vec<Self::Response>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Apply multiple commands in sequence. Read more
Source§fn is_deterministic(&self) -> bool
fn is_deterministic(&self) -> bool
Check if this state machine is deterministic. Read more
Auto Trait Implementations§
impl Freeze for BankingSMR
impl RefUnwindSafe for BankingSMR
impl Send for BankingSMR
impl Sync for BankingSMR
impl Unpin for BankingSMR
impl UnsafeUnpin for BankingSMR
impl UnwindSafe for BankingSMR
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