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§
sourcefn encode_onto<W: Writer + ?Sized>(self, w: &mut W) -> EncodeResult<()>
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§
sourcefn decode_from_reader(r: &mut Reader<'_>) -> Result<Self>
fn decode_from_reader(r: &mut Reader<'_>) -> Result<Self>
Decode a channel cell body from a provided reader.
Object Safety§
This trait is not object safe.