BufWriter

Trait BufWriter 

Source
pub trait BufWriter {
    type Error;

    // Required methods
    fn encoded_len(&self) -> usize;
    fn write(&self, buf: &mut VacantBuffer<'_>) -> Result<usize, Self::Error>;
}
Expand description

Writing self to the VacantBuffer in bytes format.

Required Associated Types§

Source

type Error

The error type.

Required Methods§

Source

fn encoded_len(&self) -> usize

The length of the encoded bytes.

Source

fn write(&self, buf: &mut VacantBuffer<'_>) -> Result<usize, Self::Error>

Encode self to bytes and write to the VacantBuffer.

Returns the number of bytes written if successful.

Implementors§

Source§

impl<A> BufWriter for A
where A: AsRef<[u8]>,

Source§

impl<T> BufWriter for MaybeStructured<'_, T>
where T: Type + ?Sized,

Source§

type Error = <T as Type>::Error

Source§

impl<W, E> BufWriter for KeyBuilder<W>
where W: Fn(&mut VacantBuffer<'_>) -> Result<usize, E>,

Source§

type Error = E

Source§

impl<W, E> BufWriter for ValueBuilder<W>
where W: Fn(&mut VacantBuffer<'_>) -> Result<usize, E>,

Source§

type Error = E