Trait WriteState

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

Source

type NextState

The uniquely determined state that is transitioned to after writing the message.

Source

type Message

The type of the message that is being written.

Required Methods§

Source

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

Produce the message to be written when transitioning to the next state.

Implementors§