pub struct PreparedQueryStream<'a> { /* private fields */ }Expand description
Streaming iterator for prepared-statement results without materializing all rows.
Holding a PreparedQueryStream keeps the underlying connection 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> PreparedQueryStream<'a>
impl<'a> PreparedQueryStream<'a>
Sourcepub fn schema(&self) -> &[Column]
pub fn schema(&self) -> &[Column]
Returns the result schema (column metadata). Always available — the columns were captured at prepare time.
Sourcepub fn next_chunk(&mut self) -> Result<Option<Vec<StreamRow>>>
pub 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 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 PreparedQueryStream<'_>
impl Debug for PreparedQueryStream<'_>
Source§impl Drop for PreparedQueryStream<'_>
impl Drop for PreparedQueryStream<'_>
Auto Trait Implementations§
impl<'a> Freeze for PreparedQueryStream<'a>
impl<'a> !RefUnwindSafe for PreparedQueryStream<'a>
impl<'a> !Send for PreparedQueryStream<'a>
impl<'a> Sync for PreparedQueryStream<'a>
impl<'a> Unpin for PreparedQueryStream<'a>
impl<'a> UnsafeUnpin for PreparedQueryStream<'a>
impl<'a> !UnwindSafe for PreparedQueryStream<'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