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) -> &'static str;
}Expand description
Encodes Arrow RecordBatches into raw bytes.
Required Methods§
Sourcefn input_schema(&self) -> SchemaRef
fn input_schema(&self) -> SchemaRef
Returns the expected input schema.
Sourcefn encode_batch(&self, batch: &RecordBatch) -> SchemaResult<Vec<Vec<u8>>>
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.
Sourcefn format_name(&self) -> &'static str
fn format_name(&self) -> &'static 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".