Trait Body

Source
pub trait Body: Readable {
    // Required method
    fn encode_onto<W: Writer + ?Sized>(self, w: &mut W) -> EncodeResult<()>;

    // Provided method
    fn decode_from_reader(r: &mut Reader<'_>) -> Result<Self> { ... }
}
Expand description

Trait for the ‘bodies’ of channel messages.

Required Methods§

Source

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

Consume this message and encode its body onto w.

Does not encode anything but the cell body, and does not pad to the cell length.

Provided Methods§

Source

fn decode_from_reader(r: &mut Reader<'_>) -> Result<Self>

Decode a channel cell body from a provided reader.

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§