RoundMsg

Trait RoundMsg 

Source
pub trait RoundMsg<M>: ProtocolMsg {
    const ROUND: u16;

    // Required methods
    fn to_protocol_msg(round_msg: M) -> Self;
    fn from_protocol_msg(protocol_msg: Self) -> Result<M, Self>;
}
Expand description

Round message

See ProtocolMsg trait documentation.

Required Associated Constants§

Source

const ROUND: u16

Number of the round this message belongs to

Required Methods§

Source

fn to_protocol_msg(round_msg: M) -> Self

Converts round message into protocol message (never fails)

Source

fn from_protocol_msg(protocol_msg: 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)

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§