Skip to main content

StructuralFieldDecoder

Trait StructuralFieldDecoder 

Source
pub trait StructuralFieldDecoder: Debug + Send {
    // Required methods
    fn accept_page(&mut self, _child: LoadedPageShard) -> Result<()>;
    fn drain(
        &mut self,
        num_rows: u64,
    ) -> Result<Box<dyn StructuralDecodeArrayTask>>;
    fn data_type(&self) -> &DataType;

    // Provided method
    fn plan_decoded_bytes(&self, _rows_remaining: u64) -> Result<[u64; 8]> { ... }
}

Required Methods§

Source

fn accept_page(&mut self, _child: LoadedPageShard) -> Result<()>

Add a newly scheduled child decoder

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

Source

fn drain(&mut self, num_rows: u64) -> Result<Box<dyn StructuralDecodeArrayTask>>

Creates a task to decode num_rows of data into an array

Source

fn data_type(&self) -> &DataType

The data type of the decoded data

Provided Methods§

Source

fn plan_decoded_bytes(&self, _rows_remaining: u64) -> Result<[u64; 8]>

Returns the exact decoded byte count for each of CANDIDATE_BATCH_SIZES row counts, clamped to rows_remaining.

Implementations should do their best to estimate the exact size required for the uncompressed data. In cases where this is not possible they should return a worst-case estimate.

The default implementation simply returns a “not supported” error though this will hopefully be removed once implementation is complete.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§