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