Trait bytecodec::monolithic::MonolithicEncode
[−]
[src]
pub trait MonolithicEncode { type Item; fn monolithic_encode<W: Write>(
&self,
item: &Self::Item,
writer: W
) -> Result<()>; }
This trait allows for encoding items monolithically to a destination byte stream.
Although this has less flexibility than Encode
trait, it has the merit of being easy to implement.
Associated Types
type Item
The type of items to be monolithically encoded.
Required Methods
fn monolithic_encode<W: Write>(
&self,
item: &Self::Item,
writer: W
) -> Result<()>
&self,
item: &Self::Item,
writer: W
) -> Result<()>
Encodes the item and writes the encoded bytes to the given writer.