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.

Object Safety§

This trait is not object safe.

Implementors§