Expand description
Server-Sent Events (text/event-stream) helpers for StreamingResponse.
Use SseDecoder for incremental parsing, parse_sse_events for complete buffers, or
StreamingResponse::read_sse_events to buffer first.
Structs§
- SseDecoder
- Incrementally parses SSE events from UTF-8 chunks (blocks delimited by
\n\n). - SseEvent
- One SSE event (may aggregate multiple
data:lines). - SseEvent
Stream - Stream of
SseEventparsed incrementally from a response body.
Functions§
- parse_
sse_ events - Parses SSE events from a buffer (blocks separated by blank lines).
- read_
sse_ from_ bytes - Reads a streaming body to completion and parses SSE events.