pub trait Packer {
    type Error;

    fn pack_bytes<B: AsRef<[u8]>>(
        &mut self,
        bytes: B
    ) -> Result<(), Self::Error>; fn written_bytes(&self) -> Option<usize> { ... } }
Expand description

A type that can pack any value that implements Packable.

Required Associated Types

An error type representing any error related to writing bytes.

Required Methods

Writes a sequence of bytes into the Packer. The totality of bytes must be written into the packer. This method must fail if the packer does not have enough space to fulfill the request.

Provided Methods

Returns the exact number of written bytes if possible.

Implementations on Foreign Types

Implementors