Skip to main content

Encoder

Trait Encoder 

Source
pub trait Encoder: Sealed {
    type W: Writer;
    type C: Config;

    // Required methods
    fn writer(&mut self) -> &mut Self::W;
    fn config(&self) -> &Self::C;
}
Expand description

Encoder trait for encoding values with configuration

This trait is the main interface for encoding values. It provides access to both the writer and the configuration.

Required Associated Types§

Source

type W: Writer

The concrete Writer type

Source

type C: Config

The concrete Config type

Required Methods§

Source

fn writer(&mut self) -> &mut Self::W

Returns a mutable reference to the writer

Source

fn config(&self) -> &Self::C

Returns a reference to the configuration

Implementations on Foreign Types§

Source§

impl<T> Encoder for &mut T
where T: Encoder,

Source§

type W = <T as Encoder>::W

Source§

type C = <T as Encoder>::C

Source§

fn writer(&mut self) -> &mut Self::W

Source§

fn config(&self) -> &Self::C

Implementors§

Source§

impl<W: Writer, C: Config> Encoder for EncoderImpl<W, C>

Source§

type W = W

Source§

type C = C