pub trait State:
Debug
+ Clone
+ Eq
+ PartialEq
+ Hash
+ Encodable
+ Decodable
+ MaybeSend
+ MaybeSync
+ 'static {
type ModuleContext: Context;
// Required methods
fn transitions(
&self,
context: &Self::ModuleContext,
global_context: &DynGlobalClientContext,
) -> Vec<StateTransition<Self>>;
fn operation_id(&self) -> OperationId;
}
Expand description
Implementors act as state machines that can be executed
Required Associated Types§
Sourcetype ModuleContext: Context
type ModuleContext: Context
Additional resources made available in this module’s state transitions
Required Methods§
Sourcefn transitions(
&self,
context: &Self::ModuleContext,
global_context: &DynGlobalClientContext,
) -> Vec<StateTransition<Self>>
fn transitions( &self, context: &Self::ModuleContext, global_context: &DynGlobalClientContext, ) -> Vec<StateTransition<Self>>
All possible transitions from the current state to other states. See
StateTransition
for details.
Sourcefn operation_id(&self) -> OperationId
fn operation_id(&self) -> OperationId
Operation this state machine belongs to. See OperationId
for
details.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
Source§impl State for TxSubmissionStatesSM
impl State for TxSubmissionStatesSM
Source§impl<S> State for OperationState<S>where
S: State,
impl<S> State for OperationState<S>where
S: State,
Wrapper for states that don’t want to carry around their operation id. S
is allowed to panic when operation_id
is called.