Skip to main content

Module sse

Module sse 

Source
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).
SseEventStream
Stream of SseEvent parsed 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.