pub trait LogicalPageDecoder: Debug + Send {
// Required methods
fn wait_for_loaded(&mut self, loaded_need: u64) -> BoxFuture<'_, Result<()>>;
fn rows_loaded(&self) -> u64;
fn num_rows(&self) -> u64;
fn rows_drained(&self) -> u64;
fn drain(&mut self, num_rows: u64) -> Result<NextDecodeTask>;
fn data_type(&self) -> &DataType;
// Provided methods
fn accept_child(&mut self, _child: DecoderReady) -> Result<()> { ... }
fn rows_unloaded(&self) -> u64 { ... }
fn rows_left(&self) -> u64 { ... }
}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§
sourcefn wait_for_loaded(&mut self, loaded_need: u64) -> BoxFuture<'_, Result<()>>
fn wait_for_loaded(&mut self, loaded_need: u64) -> BoxFuture<'_, Result<()>>
Waits until at least num_rows have been loaded
sourcefn rows_loaded(&self) -> u64
fn rows_loaded(&self) -> u64
The number of rows loaded so far
sourcefn rows_drained(&self) -> u64
fn rows_drained(&self) -> u64
The number of rows that have been drained so far
sourcefn drain(&mut self, num_rows: u64) -> Result<NextDecodeTask>
fn drain(&mut self, num_rows: u64) -> Result<NextDecodeTask>
Creates a task to decode num_rows of data into an array
Provided Methods§
sourcefn accept_child(&mut self, _child: DecoderReady) -> Result<()>
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.
sourcefn rows_unloaded(&self) -> u64
fn rows_unloaded(&self) -> u64
The number of rows that still need loading