#[non_exhaustive]pub enum ResponseCollector {
Rows,
Drain,
Stream {
header_tx: Sender<Result<StreamHeader, PgWireError>>,
row_tx: Sender<Result<StreamedRow, PgWireError>>,
},
CopyIn {
data: Vec<u8>,
},
CopyOut,
}Expand description
How to collect response messages for a request.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Rows
Collect DataRows until ReadyForQuery (for SELECT queries).
Drain
Just drain until ReadyForQuery (for setup commands like BEGIN, SET ROLE).
Stream
Stream rows one at a time via channels. Sends header first, then individual rows.
Fields
§
header_tx: Sender<Result<StreamHeader, PgWireError>>One-shot channel for the row description (sent once before any rows).
§
row_tx: Sender<Result<StreamedRow, PgWireError>>Bounded channel for individual rows; closed on completion or error.
CopyIn
COPY IN: after receiving CopyInResponse, send the provided data then CopyDone.
CopyOut
COPY OUT: collect CopyData messages until CopyDone.
Auto Trait Implementations§
impl Freeze for ResponseCollector
impl !RefUnwindSafe for ResponseCollector
impl Send for ResponseCollector
impl Sync for ResponseCollector
impl Unpin for ResponseCollector
impl UnsafeUnpin for ResponseCollector
impl !UnwindSafe for ResponseCollector
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more