Trait Encoder
trait Encoder<Item>
Trait of helper objects to write out messages as bytes, for use with
FramedWrite.
Associated Types
type Error: TraitBound { trait_: Path { path: "From", id: Id(37), args: Some(AngleBracketed { args: [Type(ResolvedPath(Path { path: "io::Error", id: Id(8), args: None }))], constraints: [] }) }, generic_params: [], modifier: None }The type of encoding errors.
FramedWriterequiresEncoders errors to implementFrom<io::Error>in the interest of letting it returnErrors directly.
Required Methods
fn encode(self: &mut Self, item: Item, dst: &mut BytesMut) -> Result<(), <Self as >::Error>Encodes a frame into the buffer provided.
This method will encode
iteminto the byte buffer provided bydst. Thedstprovided is an internal buffer of theFramedWriteinstance and will be written out when possible.
Implementors
impl Encoder for BytesCodecimpl Encoder for LengthDelimitedCodecimpl Encoder for BytesCodecimpl<T> Encoder for AnyDelimiterCodecimpl<T> Encoder for LinesCodec