Trait lance_encoding::decoder::LogicalPageDecoder

source ·
pub trait LogicalPageDecoder: Debug + Send {
    // Required methods
    fn wait(&mut self, num_rows: u64) -> BoxFuture<'_, Result<()>>;
    fn drain(&mut self, num_rows: u64) -> Result<NextDecodeTask>;
    fn unawaited(&self) -> u64;
    fn avail(&self) -> u64;
    fn data_type(&self) -> &DataType;

    // Provided method
    fn accept_child(&mut self, _child: DecoderReady) -> Result<()> { ... }
}
Expand description

A decoder for a field’s worth of data

The decoder is initially “unloaded” (doesn’t have all its data). The Self::wait method should be called to wait for the needed I/O data before attempting to decode any further.

Unlike the other decoder types it is assumed that LogicalPageDecoder is stateful and only Send. This is why we don’t need a rows_to_skip argument in Self::drain

Required Methods§

source

fn wait(&mut self, num_rows: u64) -> BoxFuture<'_, Result<()>>

Waits for enough data to be loaded to decode num_rows of data

source

fn drain(&mut self, num_rows: u64) -> Result<NextDecodeTask>

Creates a task to decode num_rows of data into an array

source

fn unawaited(&self) -> u64

The number of rows that are in the page but haven’t yet been “waited”

source

fn avail(&self) -> u64

The number of rows that have been “waited” but not yet decoded

source

fn data_type(&self) -> &DataType

The data type of the decoded data

Provided Methods§

source

fn accept_child(&mut self, _child: DecoderReady) -> Result<()>

Add a newly scheduled child decoder

The default implementation does not expect children and returns an error.

Implementors§