Trait RelayMsg

Source
pub trait RelayMsg {
    // Required methods
    fn cmd(&self) -> RelayCmd;
    fn encode_onto<W: Writer + ?Sized>(self, w: &mut W) -> EncodeResult<()>;
    fn decode_from_reader(cmd: RelayCmd, r: &mut Reader<'_>) -> Result<Self>
       where Self: Sized;
}
Expand description

Trait implemented by anything that can serve as a relay message.

Typically, this will be RelayMsg (to represent an unrestricted relay message), or a restricted subset of RelayMsg.

Required Methods§

Source

fn cmd(&self) -> RelayCmd

Return the stream command associated with this message.

Source

fn encode_onto<W: Writer + ?Sized>(self, w: &mut W) -> EncodeResult<()>

Encode the body of this message, not including command or length

Source

fn decode_from_reader(cmd: RelayCmd, r: &mut Reader<'_>) -> Result<Self>
where Self: Sized,

Extract the body of a message with command cmd from reader r.

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§