pub trait ReadState<NextState> {
type Message;
// Required method
fn read(self, msg: Self::Message) -> ProtocolResult<NextState>;
}
Expand description
A state where a message must be read before transitioning to the next state.
A state type may implement ReadState
multiple times, for different
instances of NextState
, allowing the following state to depend on the
message that was received.
Required Associated Types§
Required Methods§
Sourcefn read(self, msg: Self::Message) -> ProtocolResult<NextState>
fn read(self, msg: Self::Message) -> ProtocolResult<NextState>
Generate the next state based on the current state and the received message.