pub trait BatchSerializer: Sync + Send {
// Required method
fn serialize(
&self,
batch: RecordBatch,
initial: bool,
) -> Result<Bytes, DataFusionError>;
}Expand description
A trait that defines the methods required for a RecordBatch serializer.
Required Methods§
Sourcefn serialize(
&self,
batch: RecordBatch,
initial: bool,
) -> Result<Bytes, DataFusionError>
fn serialize( &self, batch: RecordBatch, initial: bool, ) -> Result<Bytes, DataFusionError>
Asynchronously serializes a RecordBatch and returns the serialized bytes.
Parameter initial signals whether the given batch is the first batch.
This distinction is important for certain serializers (like CSV).