Trait EncoderState

Source
pub trait EncoderState<'a, P: Packable + ?Sized + 'a>:
    Debug
    + Default
    + Clone {
    // Required methods
    fn is_empty(&self) -> bool;
    fn append_chunk<W: Writer<'a, P>>(
        &mut self,
        writer: &mut W,
        chunk: Run<'a, P>,
    ) -> usize;
    fn flush<W: Writer<'a, P>>(&mut self, writer: &mut W);

    // Provided methods
    fn append<W: Writer<'a, P>>(
        &mut self,
        writer: &mut W,
        value: Option<Cow<'a, P>>,
    ) -> usize { ... }
    fn append_first_chunk(
        &mut self,
        writer: &mut SlabWriter<'a, P>,
        chunk: Run<'a, P>,
        _slab: &Slab,
    ) -> bool { ... }
    fn copy_slab<C: ColumnCursor<State<'a> = Self, Item = P>>(
        &mut self,
        writer: &mut SlabWriter<'a, P>,
        slab: &'a Slab,
    ) { ... }
}

Required Methods§

Source

fn is_empty(&self) -> bool

Source

fn append_chunk<W: Writer<'a, P>>( &mut self, writer: &mut W, chunk: Run<'a, P>, ) -> usize

Source

fn flush<W: Writer<'a, P>>(&mut self, writer: &mut W)

Provided Methods§

Source

fn append<W: Writer<'a, P>>( &mut self, writer: &mut W, value: Option<Cow<'a, P>>, ) -> usize

Source

fn append_first_chunk( &mut self, writer: &mut SlabWriter<'a, P>, chunk: Run<'a, P>, _slab: &Slab, ) -> bool

Source

fn copy_slab<C: ColumnCursor<State<'a> = Self, Item = P>>( &mut self, writer: &mut SlabWriter<'a, P>, slab: &'a Slab, )

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<'a> EncoderState<'a, [u8]> for ()

Source§

fn is_empty(&self) -> bool

Source§

fn append_chunk<W: Writer<'a, [u8]>>( &mut self, writer: &mut W, run: Run<'a, [u8]>, ) -> usize

Source§

fn copy_slab<C: ColumnCursor<State<'a> = Self, Item = [u8]>>( &mut self, writer: &mut SlabWriter<'a, [u8]>, slab: &'a Slab, )

Source§

fn flush<W: Writer<'a, [u8]>>(&mut self, _writer: &mut W)

Implementors§