pub trait Decoder: Send + Debug {
// Required methods
fn decode(&mut self, buf: &[u8]) -> Result<usize, ArrowError>;
fn flush(&mut self) -> Result<Option<RecordBatch>, ArrowError>;
fn can_flush_early(&self) -> bool;
}Expand description
A general interface for decoders such as arrow::json::reader::Decoder and
arrow::csv::reader::Decoder. Defines an interface similar to
Decoder::decode and Decoder::flush methods, but also includes
a method to check if the decoder can flush early. Intended to be used in
conjunction with DecoderDeserializer.
Required Methods§
Sourcefn flush(&mut self) -> Result<Option<RecordBatch>, ArrowError>
fn flush(&mut self) -> Result<Option<RecordBatch>, ArrowError>
Sourcefn can_flush_early(&self) -> bool
fn can_flush_early(&self) -> bool
Whether the decoder can flush early in its current state.