pub struct StreamOptions { /* private fields */ }Expand description
Execution options for the server-streaming query RPC. Default is server-side defaults (batch sizing, CURSOR retrieval, full records).
use arcadedb_protocol::{Params, stream::{RetrievalMode, StreamOptions}};
use std::ops::ControlFlow;
let summary = client
.stream_query_with_options(
"mydb",
"SELECT FROM item",
Params::default(),
StreamOptions::new()
.batch_size(50_000)
.retrieval_mode(RetrievalMode::Paged),
|_batch| ControlFlow::Continue(()),
)
.await?;
println!("{} rows in {} batches", summary.rows, summary.batches);Implementations§
Source§impl StreamOptions
impl StreamOptions
Sourcepub fn batch_size(self, size: u32) -> Self
pub fn batch_size(self, size: u32) -> Self
Records per streamed batch: larger batches amortize per-batch overhead, smaller batches keep memory flat.
Sourcepub fn retrieval_mode(self, mode: RetrievalMode) -> Self
pub fn retrieval_mode(self, mode: RetrievalMode) -> Self
Wire retrieval mode:
Cursor(server default) — run once, stream while iterating.MaterializeAll— server loads the full result, then emits batches.Paged— server re-issuesLIMIT/SKIPper batch (consistent snapshots of moving data, at the cost of re-execution).
Sourcepub fn projection(self, settings: ProjectionSettings) -> Self
pub fn projection(self, settings: ProjectionSettings) -> Self
Server-side projection settings (field selection — the proto’s
ProjectionSettings), when the query’s shape should be narrowed
without rewriting the SQL text.
Trait Implementations§
Source§impl Clone for StreamOptions
impl Clone for StreamOptions
Source§impl Debug for StreamOptions
impl Debug for StreamOptions
Auto Trait Implementations§
impl Freeze for StreamOptions
impl RefUnwindSafe for StreamOptions
impl Send for StreamOptions
impl Sync for StreamOptions
impl Unpin for StreamOptions
impl UnsafeUnpin for StreamOptions
impl UnwindSafe for StreamOptions
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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