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§
sourcefn encode_onto<W: Writer + ?Sized>(self, w: &mut W) -> EncodeResult<()>
fn encode_onto<W: Writer + ?Sized>(self, w: &mut W) -> EncodeResult<()>
Encode the body of this message, not including command or length
Object Safety§
This trait is not object safe.