Skip to main content

StageState

Trait StageState 

Source
pub trait StageState<Proto: ProtocolState<R>, R: RoleT>: Sized + SendData {
    type LocalIn: SendData;

    // Required methods
    fn local(
        self,
        proto: &Proto,
        input: Self::LocalIn,
        eff: &Effects<Inputs<Self::LocalIn>>,
    ) -> impl Future<Output = Result<(Option<Proto::Action>, Self)>> + Send;
    fn network(
        self,
        proto: &Proto,
        input: Proto::Out,
        eff: &Effects<Inputs<Self::LocalIn>>,
    ) -> impl Future<Output = Result<(Option<Proto::Action>, Self)>> + Send;
    fn muxer(&self) -> &StageRef<MuxMessage>;
}
Expand description

This tracks the stage state that is used to make decisions based on inputs from the local node (LocalIn) or incoming network messages (NetworkIn). It may emit network actions to be performed via the Action type.

Required Associated Types§

Required Methods§

Source

fn local( self, proto: &Proto, input: Self::LocalIn, eff: &Effects<Inputs<Self::LocalIn>>, ) -> impl Future<Output = Result<(Option<Proto::Action>, Self)>> + Send

Source

fn network( self, proto: &Proto, input: Proto::Out, eff: &Effects<Inputs<Self::LocalIn>>, ) -> impl Future<Output = Result<(Option<Proto::Action>, Self)>> + Send

Source

fn muxer(&self) -> &StageRef<MuxMessage>

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§