Skip to main content

AvroFormat

Trait AvroFormat 

Source
pub trait AvroFormat: Debug + Default {
    const NEEDS_PREFIX: bool;

    // Required methods
    fn start_stream<W: Write>(
        &mut self,
        writer: &mut W,
        schema: &Schema,
        compression: Option<CompressionCodec>,
    ) -> Result<(), AvroError>;
    fn sync_marker(&self) -> Option<&[u8; 16]>;
}
Expand description

Format abstraction implemented by each container‐level writer.

Required Associated Constants§

Source

const NEEDS_PREFIX: bool

If true, the writer for this format will query single_object_prefix() and write the prefix before each record. If false, the writer can skip this step. This is a performance hint for the writer.

Required Methods§

Source

fn start_stream<W: Write>( &mut self, writer: &mut W, schema: &Schema, compression: Option<CompressionCodec>, ) -> Result<(), AvroError>

Write any bytes required at the very beginning of the output stream (file header, etc.). Implementations must not write any record data.

Source

fn sync_marker(&self) -> Option<&[u8; 16]>

Return the 16‑byte sync marker (OCF) or None (binary stream).

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§