Trait ReadState

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

Source

type Message

The type of message to be read.

Required Methods§

Source

fn read(self, msg: Self::Message) -> ProtocolResult<NextState>

Generate the next state based on the current state and the received message.

Implementors§