pub struct GrpcChunkStream { /* private fields */ }Expand description
Streaming producer of Arrow IPC byte chunks from a gRPC query.
Unlike GrpcClient::execute_query,
which drains every result chunk into a single GrpcQueryResult before
returning, this type yields one Bytes chunk at a time. The caller can
decode each chunk (e.g. via arrow_ipc::reader::StreamDecoder) and drop
it before fetching the next, so memory stays bounded by roughly one
message (capped at the tonic max_decoding_message_size, default 64 MB)
regardless of total result size.
Built by GrpcClient::execute_query_stream
and the AuthenticatedGrpcClient variant.
Implementations§
Source§impl GrpcChunkStream
impl GrpcChunkStream
Sourcepub async fn next_chunk(&mut self) -> Result<Option<Bytes>>
pub async fn next_chunk(&mut self) -> Result<Option<Bytes>>
Returns the next Arrow IPC byte chunk from the stream, or None when
the server has signalled that the stream is complete.
§Errors
Propagates any error from the underlying executor’s
next_result call — typically tonic::Status errors wrapped
as Error (server-side query failure, auth expiry, or
transport-level gRPC errors).
Sourcepub fn schema(&self) -> Option<&QueryResultSchema>
pub fn schema(&self) -> Option<&QueryResultSchema>
Returns the schema reported by the server for this query, if one has been received yet.
The schema is typically delivered as the first message on the stream,
so it is usually available after the first next_chunk() call.
Sourcepub fn query_id(&self) -> Option<&str>
pub fn query_id(&self) -> Option<&str>
Returns the server-assigned query ID, if one has been received.
Sourcepub fn rows_affected(&self) -> Option<u64>
pub fn rows_affected(&self) -> Option<u64>
Returns the affected row count for DML queries, if reported.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for GrpcChunkStream
impl !RefUnwindSafe for GrpcChunkStream
impl Send for GrpcChunkStream
impl Sync for GrpcChunkStream
impl Unpin for GrpcChunkStream
impl UnsafeUnpin for GrpcChunkStream
impl !UnwindSafe for GrpcChunkStream
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> 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>
T in a tonic::Request