pub struct AsyncQueryStream<'a> { /* private fields */ }Expand description
Streaming iterator for query results without materializing all rows (async).
Holding an AsyncQueryStream keeps the underlying
AsyncRawConnection locked via a MutexGuard. Dropping the stream
before fully iterating triggers a server-side cancel (see Drop below)
so the connection is returned to a usable state.
Implementations§
Source§impl<'a> AsyncQueryStream<'a>
impl<'a> AsyncQueryStream<'a>
Sourcepub fn schema(&self) -> Option<&[Column]>
pub fn schema(&self) -> Option<&[Column]>
Returns the schema (column metadata) for the result set, once the
first RowDescription has been read.
Sourcepub async fn next_chunk(&mut self) -> Result<Option<Vec<StreamRow>>>
pub async fn next_chunk(&mut self) -> Result<Option<Vec<StreamRow>>>
Retrieves the next chunk of rows (up to chunk_size).
Returns Ok(Some(rows)) for each chunk, Ok(None) after the final
ReadyForQuery, and Err(_) if the server sent an ErrorResponse.
§Errors
- Returns
Error(I/O) /Error(closed) if the async transport fails while awaiting the next protocol message. - Returns
Error(server) when the server sends anErrorResponsepartway through the result stream.
Trait Implementations§
Source§impl Debug for AsyncQueryStream<'_>
impl Debug for AsyncQueryStream<'_>
Source§impl Drop for AsyncQueryStream<'_>
impl Drop for AsyncQueryStream<'_>
Auto Trait Implementations§
impl<'a> Freeze for AsyncQueryStream<'a>
impl<'a> !RefUnwindSafe for AsyncQueryStream<'a>
impl<'a> Send for AsyncQueryStream<'a>
impl<'a> Sync for AsyncQueryStream<'a>
impl<'a> Unpin for AsyncQueryStream<'a>
impl<'a> UnsafeUnpin for AsyncQueryStream<'a>
impl<'a> !UnwindSafe for AsyncQueryStream<'a>
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request