pub trait WriteState {
type NextState;
type Message;
// Required method
fn write(self) -> ProtocolResult<(Self::NextState, Self::Message)>;
}
Expand description
A state where a message must be written before transitioning to the next state.
WriteState
can only be implemented once by every state type, implying that
in any protocol party state, if a message is to be written, that message and
the state the party is in after writing the message are uniquely determined.
Required Associated Types§
Required Methods§
Sourcefn write(self) -> ProtocolResult<(Self::NextState, Self::Message)>
fn write(self) -> ProtocolResult<(Self::NextState, Self::Message)>
Produce the message to be written when transitioning to the next state.