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§
Required Methods§
Sourcefn to_protocol_message(round_message: M) -> Self
fn to_protocol_message(round_message: M) -> Self
Converts round message into protocol message (never fails)
Sourcefn from_protocol_message(protocol_message: Self) -> Result<M, Self>
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)
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.