Skip to main content

RecordParser

Trait RecordParser 

Source
pub trait RecordParser: Send + Sync {
    // Required methods
    fn validate(&self, bytes: &[u8]) -> Result<()>;
    fn parse_chunk(
        &self,
        bytes: &[u8],
        sink: &mut dyn ColumnarSink,
    ) -> Result<()>;

    // Provided method
    fn parse_chunk_generic<S: ColumnarSink>(
        &self,
        bytes: &[u8],
        sink: &mut S,
    ) -> Result<()>
       where Self: Sized { ... }
}
Expand description

Format-specific parser: turns a byte chunk into field/value events sent to a ColumnarSink.

Required Methods§

Source

fn validate(&self, bytes: &[u8]) -> Result<()>

Validate that the whole byte slice is well-formed for this format.

Source

fn parse_chunk(&self, bytes: &[u8], sink: &mut dyn ColumnarSink) -> Result<()>

Parse one chunk and feed all row events into sink (object-safe, virtual).

Provided Methods§

Source

fn parse_chunk_generic<S: ColumnarSink>( &self, bytes: &[u8], sink: &mut S, ) -> Result<()>
where Self: Sized,

Parse one chunk generically (monomorphized, inlinable).

Default impl delegates to parse_chunk (object-safe) for adapters that have not yet migrated. Adapters that implement this directly get devirtualized sink calls and cross-crate inlining.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§