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

Helper trait to encode basic types into.

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 config

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 <&mut T as Encoder>::W

Source§

fn config(&self) -> &<&mut T as Encoder>::C

Implementors§

Source§

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

Source§

type W = W

Source§

type C = C