Trait round_based::rounds_router::RoundMessage

source ·
pub trait RoundMessage<M>: ProtocolMessage {
    const ROUND: u16;

    // Required methods
    fn to_protocol_message(round_message: M) -> Self;
    fn from_protocol_message(protocol_message: Self) -> Result<M, Self>;
}
Expand description

Round message

See ProtocolMessage trait documentation.

Required Associated Constants§

source

const ROUND: u16

Number of the round this message belongs to

Required Methods§

source

fn to_protocol_message(round_message: M) -> Self

Converts round message into protocol message (never fails)

source

fn from_protocol_message(protocol_message: Self) -> Result<M, Self>

Extracts round message from protocol message

Returns Err(protocol_message) if protocol_message.round() != Self::ROUND, otherwise returns Ok(round_message)

Object Safety§

This trait is not object safe.

Implementors§