pub struct ResultStream<'session> { /* private fields */ }Expand description
Lazy, chunk-based result stream bound to a session’s lifetime.
Created by Session::execute_streaming.
Iterate via next_chunk for chunk granularity or
into_row_iter for a row iterator.
§Stability: Experimental
Implementations§
Source§impl<'s> ResultStream<'s>
impl<'s> ResultStream<'s>
Sourcepub fn column_types(&self) -> &[LogicalType]
pub fn column_types(&self) -> &[LogicalType]
Column types. Initially Any; refined after the first non-empty chunk.
Sourcepub fn next_chunk(&mut self) -> Result<Option<DataChunk>>
pub fn next_chunk(&mut self) -> Result<Option<DataChunk>>
Pulls the next chunk from the pipeline.
Returns Ok(None) when the stream is exhausted.
§Errors
Propagates operator errors and returns Error::Query(QueryError::Timeout)
if the session’s query deadline has passed.
Sourcepub fn into_row_iter(self) -> RowIterator<'s> ⓘ
pub fn into_row_iter(self) -> RowIterator<'s> ⓘ
Converts to a row-level iterator that buffers one chunk internally.
Sourcepub fn collect(self) -> Result<QueryResult>
pub fn collect(self) -> Result<QueryResult>
Drains the stream into a fully materialized QueryResult.
Useful as an escape hatch when a caller requested streaming but then
decides to collect everything (e.g., stream.collect()? in tests).
§Errors
Propagates operator errors and deadline timeouts.
Auto Trait Implementations§
impl<'session> Freeze for ResultStream<'session>
impl<'session> !RefUnwindSafe for ResultStream<'session>
impl<'session> Send for ResultStream<'session>
impl<'session> Sync for ResultStream<'session>
impl<'session> Unpin for ResultStream<'session>
impl<'session> UnsafeUnpin for ResultStream<'session>
impl<'session> !UnwindSafe for ResultStream<'session>
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more