Skip to main content

Module sub

Module sub 

Source
Expand description

Streaming response types for the Corrosion HTTP API.

Each long-running endpoint exposes a dedicated Stream implementation:

  • QueryStream — one-shot query results (POST /v1/queries).
  • SubscriptionStream — resumable live subscription (POST /v1/subscriptions); transparently reconnects with the last observed ChangeId on transient I/O errors.
  • UpdatesStream — table-level update feed (POST /v1/updates/{table}).

All three decode JSON-lines responses through the LinesBytesCodec defined here, which is a port of tokio-util’s LinesCodec adapted to emit bytes::BytesMut frames.

Structs§

IoBodyStream
Adapter that exposes a reqwest::Body as a Stream of io::Result<Bytes>, mapping framing errors into io::Error so the underlying StreamReader can consume them.
LinesBytesCodec
LinesBytesCodec used to to split up bytes into lines. It uses the \n character as the line delimiter.
QueryStream
Stream returned by crate::CorrosionApiClient::query_typed for a single query.
SubscriptionStream
Live subscription stream returned by crate::CorrosionApiClient::subscribe_typed.
UpdatesStream
Stream returned by crate::CorrosionApiClient::updates_typed.

Enums§

QueryError
Errors yielded by QueryStream.
SubscriptionError
Errors yielded by SubscriptionStream.
UpdatesError
Errors yielded by UpdatesStream.