Skip to main content

Module framing

Module framing 

Source
Expand description

Incremental SSE and newline-delimited framing of response bytes. SSE dispatch requires a blank line; incomplete events are not flushed at EOF. NDJSON permits a final unterminated line through NdjsonFramer::finish.

use rig_http::http_client::framing::NdjsonFramer;

let mut framer = NdjsonFramer::new();
assert_eq!(framer.push(b"{}\n").collect::<Vec<_>>(), vec![b"{}".to_vec()]);

Structs§

NdjsonFramer
Splits nonempty newline-delimited payloads without validating JSON. A nonempty unterminated last line is available through Self::finish.
SseEvent
One dispatched text/event-stream event.
SseFramer
A push parser for the WHATWG text/event-stream grammar.

Enums§

Framing
How a reply’s bytes are split into wire frames.
WireFrame
One transport frame, after framing but before decoding.