Skip to main content

StreamFormatEncode

Trait StreamFormatEncode 

Source
pub trait StreamFormatEncode<T>: StreamFormat {
    type Encoder: ItemEncoder<T>;

    // Required method
    fn encoder(&self) -> Self::Encoder;
}
Expand description

Encodes items of type T into bytes.

Required Associated Types§

Source

type Encoder: ItemEncoder<T>

The per-stream encoder. A fresh one is built for every body, because framing state (item index, Arrow’s dictionary tracker, CSV’s header flag) is per-stream.

Required Methods§

Source

fn encoder(&self) -> Self::Encoder

Build an encoder for one body.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl StreamFormatEncode<RecordBatch> for ArrowRecordBatchIpcStreamFormat

Available on crate feature arrow only.
Source§

impl StreamFormatEncode<String> for TextStreamFormat

Available on crate feature text only.
Source§

impl<T, E> StreamFormatEncode<T> for JsonArrayStreamFormat<E>
where T: Serialize, E: Serialize,

Available on crate feature json only.
Source§

impl<T> StreamFormatEncode<T> for CsvStreamFormat
where T: Serialize,

Available on crate feature csv only.
Source§

impl<T> StreamFormatEncode<T> for JsonNewLineStreamFormat
where T: Serialize,

Available on crate feature json only.
Source§

impl<T> StreamFormatEncode<T> for ProtobufStreamFormat
where T: Message,

Available on crate feature protobuf only.