Skip to main content

Module format

Module format 

Source
Expand description

The symmetric format abstraction: one trait for identity, one per direction.

Deliberately item-level rather than stream-level. A stream-level trait would have to name a concrete stream error type in its signature, which is exactly what ties axum_streams::StreamingFormat to axum::Error and makes it unmovable. Encoding an item into a buffer names nothing but StreamError.

ItemEncoder::prologue and ItemEncoder::epilogue exist because framing is not purely per-item: a JSON array opens with [ and closes with ], and Arrow IPC ends with an eight-byte end-of-stream marker. This is precisely the hook that tokio_util::codec::Encoder lacks (FramedWrite never calls anything at end of stream), and the reason this crate does not implement that trait.

Structs§

DecodeOptions
Limits applied while decoding.
IdentityParser
Yields frames unchanged, for formats whose framer already produces items.

Constants§

DEFAULT_BUF_CAPACITY
8 KiB, matching the existing reqwest-streams default.

Traits§

DefaultFormat
A format that can be constructed without configuration.
FrameParser
Turns one framed record into an item.
ItemEncoder
Per-stream encoding state.
StreamFormat
Identity and content-type negotiation, shared by both directions.
StreamFormatDecode
Decodes bytes into items of type T.
StreamFormatEncode
Encodes items of type T into bytes.