Struct HeaderDecoder

Source
pub struct HeaderDecoder {
    state: HeaderDecoderState,
    vlq_decoder: VLQDecoder,
    meta_offsets: Vec<usize>,
    meta_buf: Vec<u8>,
    sync_marker: [u8; 16],
    tuples_remaining: usize,
    bytes_remaining: usize,
}
Expand description

A decoder for Header

The avro file format does not encode the length of the header, and so it is necessary to provide a push-based decoder that can be used with streams

Fields§

§state: HeaderDecoderState§vlq_decoder: VLQDecoder§meta_offsets: Vec<usize>

The end offsets of strings in meta_buf

§meta_buf: Vec<u8>

The raw binary data of the metadata map

§sync_marker: [u8; 16]

The decoded sync marker

§tuples_remaining: usize

The number of remaining tuples in the current block

§bytes_remaining: usize

The number of bytes remaining in the current string/bytes payload

Implementations§

Source§

impl HeaderDecoder

Source

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

Parse Header from buf, returning the number of bytes read

This method can be called multiple times with consecutive chunks of data, allowing integration with chunked IO systems like BufRead::fill_buf

All errors should be considered fatal, and decoding aborted

Once the entire Header has been decoded this method will not read any further input bytes, and the header can be obtained with Self::flush

Source

pub fn flush(&mut self) -> Option<Header>

Flush this decoder returning the parsed Header if any

Trait Implementations§

Source§

impl Debug for HeaderDecoder

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for HeaderDecoder

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,