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.
Object Safety§
This trait is not object safe.
Implementors§
source§impl State for TxSubmissionStates
impl State for TxSubmissionStates
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.