Skip to main content

Module reader

Module reader 

Source
Expand description

Reader (per-connection) + Cursor (per-query) public API.

Each Reader allows at most one in-flight cursor at a time (runtime-checked, not type-encoded). Cursor::cancel() issues a CANCEL frame and drains until the terminal frame, leaving the Reader reusable. Dropping a cursor before it has reached a terminal closes the underlying WebSocket: subsequent operations on the Reader fail at the transport layer (open a fresh Reader to recover). Call Cursor::cancel() (or read until next_batch() returns None) before drop if you want to keep the existing connection alive.

The sync-reader-qwp-ws feature gate is applied at the module declaration in egress/mod.rs; an inner #![cfg(...)] here would duplicate that gate (clippy::duplicated_attributes) without changing what’s compiled.

Structs§

BatchView
Borrowed view over the most recently decoded batch.
Cursor
Streaming cursor over RESULT_BATCH frames.
FailoverProgressEvent
Notification delivered to the ReaderQuery::on_failover_progress callback at each transition of a mid-query failover lifecycle. See FailoverPhase for the per-variant semantics.
FailoverResetEvent
Notification delivered to the ReaderQuery::on_failover_reset callback right before replayed batches start arriving on a new connection. Mirrors the Java onFailoverReset(newNode) contract: the user-side handler is responsible for discarding any rows it had accumulated from the previous (now-dead) connection, since the query restarts from batch_seq=0 against the new endpoint.
Reader
Per-connection reader. Owns the WebSocket transport and the connection-scoped symbol dictionary.
ReaderQuery
Borrows a Reader exclusively while the query is being constructed and (eventually) the cursor is live.
ReaderStats
Diagnostic counters shared between a Reader and its FFI handle.

Enums§

FailoverPhase
Phase discriminant on FailoverProgressEvent.
Terminal
Reason the stream ended. Surfaced via Cursor::terminal once next_batch returns None.