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§
- Decode
Options - Limits applied while decoding.
- Identity
Parser - Yields frames unchanged, for formats whose framer already produces items.
Constants§
- DEFAULT_
BUF_ CAPACITY - 8 KiB, matching the existing
reqwest-streamsdefault.
Traits§
- Default
Format - A format that can be constructed without configuration.
- Frame
Parser - Turns one framed record into an item.
- Item
Encoder - Per-stream encoding state.
- Stream
Format - Identity and content-type negotiation, shared by both directions.
- Stream
Format Decode - Decodes bytes into items of type
T. - Stream
Format Encode - Encodes items of type
Tinto bytes.