fedimint_client::sm::state

Trait State

source
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§

source

type ModuleContext: Context

Additional resources made available in this module’s state transitions

Required Methods§

source

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.

source

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 TxSubmissionStatesSM

source§

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.