Trait BaseEncoder

Source
pub trait BaseEncoder {
    type Error;
}
Expand description

A trait that defines common types and operations for encoders.

An encoder is a type that can gather encoded data into a specific output format. These are typically buffers, but can also be other types that perform some operation on the encoded result. An example type is the SizeEncoder type, which counts how many bytes would be encoded and is often used for sizing the output buffer before encoding.

The BaseEncoder trait is the foundation for all encoders, providing a common interface for encoding operations. It’s also the main building block for all combinators.

Required Associated Types§

Source

type Error

The error type returned by all encoding operations.

For example, an encoder might return an error if the output buffer is full.

Implementations on Foreign Types§

Source§

impl BaseEncoder for &mut [u8]

Source§

impl BaseEncoder for ()

Source§

impl BaseEncoder for String

Source§

impl BaseEncoder for Vec<u8>

Source§

impl BaseEncoder for Formatter<'_>

Source§

impl BaseEncoder for BytesMut

Source§

impl<const SIZE: usize> BaseEncoder for ArrayString<SIZE>

Source§

impl<const SIZE: usize> BaseEncoder for ArrayVec<u8, SIZE>

Implementors§