pub struct QueryRequest<'a> { /* private fields */ }Expand description
Builder produced by Client::sql, Client::influxql, or
Client::query; chain options, then .await (for a collected
QueryResult) or .stream() (for a streaming BatchStream).
Implementations§
Source§impl<'a> QueryRequest<'a>
impl<'a> QueryRequest<'a>
Sourcepub fn param(self, key: impl Into<String>, value: impl Into<Value>) -> Self
pub fn param(self, key: impl Into<String>, value: impl Into<Value>) -> Self
Add a single named parameter.
Sourcepub fn params<K, V, I>(self, params: I) -> Self
pub fn params<K, V, I>(self, params: I) -> Self
Add multiple named parameters from an iterable.
Sourcepub fn header(self, k: impl Into<String>, v: impl Into<String>) -> Self
pub fn header(self, k: impl Into<String>, v: impl Into<String>) -> Self
Add a gRPC metadata header sent with the Flight DoGet request.
Sourcepub fn retry(self, policy: RetryConfig) -> Self
pub fn retry(self, policy: RetryConfig) -> Self
Override the retry policy for this query (defaults to the client’s).
Sourcepub async fn stream(self) -> Result<BatchStream>
pub async fn stream(self) -> Result<BatchStream>
Open the query as a streaming BatchStream instead of collecting.
Use this for results too large to materialise in memory.
Only the connection setup is retried; once batches start arriving a stream can’t be replayed, so mid-stream errors propagate to the caller.
Trait Implementations§
Source§impl<'a> IntoFuture for QueryRequest<'a>
impl<'a> IntoFuture for QueryRequest<'a>
Source§type Output = Result<QueryResult, Error>
type Output = Result<QueryResult, Error>
The output that the future will produce on completion.
Source§type IntoFuture = Pin<Box<dyn Future<Output = <QueryRequest<'a> as IntoFuture>::Output> + Send + 'a>>
type IntoFuture = Pin<Box<dyn Future<Output = <QueryRequest<'a> as IntoFuture>::Output> + Send + 'a>>
Which kind of future are we turning this into?
Source§fn into_future(self) -> Self::IntoFuture
fn into_future(self) -> Self::IntoFuture
Creates a future from a value. Read more
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for QueryRequest<'a>
impl<'a> !UnwindSafe for QueryRequest<'a>
impl<'a> Freeze for QueryRequest<'a>
impl<'a> Send for QueryRequest<'a>
impl<'a> Sync for QueryRequest<'a>
impl<'a> Unpin for QueryRequest<'a>
impl<'a> UnsafeUnpin for QueryRequest<'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