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§
Required Methods§
Sourcefn to_protocol_msg(round_msg: M) -> Self
fn to_protocol_msg(round_msg: M) -> Self
Converts round message into protocol message (never fails)
Sourcefn from_protocol_msg(protocol_msg: Self) -> Result<M, Self>
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.