Expand description
The event stream runtime: one long-lived GET answered with
text/event-stream, reconnected and resumed by itself.
It follows packages/sdk-codegen/streams/CONTRACT.md, and
tests/api/stream_conformance.rs holds it to that contract with the
scenarios every SDK shares.
EventStream is the stream: ask it for the next event, or turn it into
a futures_util::Stream. Everything
under it is public too, for a caller that drives the connection itself:
the StreamTransport that opens a connection, the SseParser that
reads one, and the StreamBudget that paces connects.
Structs§
- Connect
Request - The request one connect sends.
- Event
Stream - An event stream. It connects, reads, reconnects with its cursor and
waits between connects by itself, and stops only when it is closed or on
a terminal
StreamError. - Http
Stream Transport - The real transport: the client’s own
reqwestclient, key and project. - Reconnecting
- The stream is not connected and will connect again.
- Refused
- An answer to a connect that is not the stream. The body is capped.
- SseParser
- Incremental parser of the event stream format.
- Stream
Budget - How many connects a rolling window allows. Clones share one count: every stream of one client draws on the same budget, so a caller that opens streams in a loop is paced like one that keeps a single stream.
- Stream
Error - A terminal stream failure: the stream has stopped and connects no more,
until
EventStream::restart_afteris called. - Stream
Event - One event of the stream: the same envelope a webhook carries.
- Stream
Limits - The stream’s sizes and counts.
- Stream
Options - How one stream is run. Every field has a default: the stream’s own.
- Stream
Refusal - What one answer that is not the stream means.
- Stream
Spec - The description of a stream: what the generator read from its config.
- Stream
Timing - The stream’s times.
Enums§
- Answer
- What a connect came to, when it got an answer.
- Reconnect
Reason - Why a connection ended or a connect failed, when the stream tries again.
- Skip
Reason - Why a frame was dropped.
- SseItem
- What the parser found in the bytes it was fed.
- Stream
Error Kind - Why a stream ended for good. Everything else is retried and never an error.
- Stream
Item - Something a stream reports, in the order it happens.
- Stream
State - Where a stream is.
Traits§
- Stream
Body - The body of an open stream.
- Stream
Transport - Opens the stream.
Erris a connect that got no answer: network, TLS.
Functions§
- check_
stream_ url - Whether the stream can be read from
url:Errsays why not.