Trait mz_persist_types::columnar::ColumnEncoder

source ·
pub trait ColumnEncoder<T> {
    type FinishedColumn: Array + Debug + 'static;

    // Required methods
    fn goodbytes(&self) -> usize;
    fn append(&mut self, val: &T);
    fn append_null(&mut self);
    fn finish(self) -> Self::FinishedColumn;
}
Expand description

An encoder for values of a fixed schema

This allows us to amortize the cost of downcasting columns into concrete types.

Required Associated Types§

source

type FinishedColumn: Array + Debug + 'static

Type of column that this encoder returns when finalized.

Required Methods§

source

fn goodbytes(&self) -> usize

The amount of “actual data” encoded by this encoder so far.

source

fn append(&mut self, val: &T)

Appends val onto this encoder.

source

fn append_null(&mut self)

Appends a null value onto this encoder.

source

fn finish(self) -> Self::FinishedColumn

Finish this encoder, returning an immutable column.

Implementors§