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