Skip to main content

FormatEncoder

Trait FormatEncoder 

Source
pub trait FormatEncoder: Send + Sync {
    // Required methods
    fn input_schema(&self) -> SchemaRef;
    fn encode_batch(&self, batch: &RecordBatch) -> SchemaResult<Vec<Vec<u8>>>;
    fn format_name(&self) -> &str;
}
Expand description

Encodes Arrow RecordBatches into raw bytes.

Required Methods§

Source

fn input_schema(&self) -> SchemaRef

Returns the expected input schema.

Source

fn encode_batch(&self, batch: &RecordBatch) -> SchemaResult<Vec<Vec<u8>>>

Encodes a RecordBatch into a vector of byte records.

Each element in the returned vector represents one serialized record.

§Errors

Returns a schema error if encoding fails.

Source

fn format_name(&self) -> &str

Returns the name of the format this encoder produces (e.g., "json").

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§