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 { ... }
fn max_rows_to_drain(
&self,
num_rows: u64,
_byte_budget: u64,
) -> Result<DrainLimit> { ... }
}Expand description
Stateful decoder for one logical page.
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
Sourcefn max_rows_to_drain(
&self,
num_rows: u64,
_byte_budget: u64,
) -> Result<DrainLimit>
fn max_rows_to_drain( &self, num_rows: u64, _byte_budget: u64, ) -> Result<DrainLimit>
Returns how many of the requested rows can be decoded into one Arrow array
while keeping every i32 offset buffer within byte_budget bytes.
Most page decoders can always drain the full request and consume no budget. Decoders that build arrays with i32 offsets (Utf8 / Binary / List) may return fewer rows so that the concatenated array’s offsets stay representable, and report the budget those rows consume so callers can accumulate across pages.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".