Skip to main content

ArrowDecoder

Trait ArrowDecoder 

Source
pub trait ArrowDecoder: Send + 'static {
    // Required methods
    fn decode(&mut self, buf: &[u8]) -> Result<usize, ArrowError>;
    fn flush(&mut self) -> Result<Option<RecordBatch>, ArrowError>;
}

Required Methods§

Source

fn decode(&mut self, buf: &[u8]) -> Result<usize, ArrowError>

Decode records from buf returning the number of bytes read.

This method returns Ok(0) once batch_size objects have been parsed since the last call to Self::flush, or buf is exhausted.

Any remaining bytes should be included in the next call to Self::decode.

Source

fn flush(&mut self) -> Result<Option<RecordBatch>, ArrowError>

Flushes the currently buffered data to a [RecordBatch].

This should only be called after Self::decode has returned Ok(0), otherwise may return an error if part way through decoding a record

Returns Ok(None) if no buffered data.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl ArrowDecoder for Decoder

Source§

fn decode(&mut self, buf: &[u8]) -> Result<usize, ArrowError>

Source§

fn flush(&mut self) -> Result<Option<RecordBatch>, ArrowError>

Source§

impl ArrowDecoder for Decoder

Source§

fn decode(&mut self, buf: &[u8]) -> Result<usize, ArrowError>

Source§

fn flush(&mut self) -> Result<Option<RecordBatch>, ArrowError>

Implementors§