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
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.