pub struct QueryExecutionRequest<'hlx, 'a, R> { /* private fields */ }Expand description
A fully addressed request, ready to send.
Produced once a query has been attached via QueryBuilder::query.
Implementations§
Source§impl<'hlx, 'a, R> QueryExecutionRequest<'hlx, 'a, R>
impl<'hlx, 'a, R> QueryExecutionRequest<'hlx, 'a, R>
Sourcepub async fn send_bytes(self) -> Result<Vec<u8>, HelixError>
pub async fn send_bytes(self) -> Result<Vec<u8>, HelixError>
Send the request and return the successful response body unchanged.
Source§impl<'hlx, 'a, R: for<'de> Deserialize<'de>> QueryExecutionRequest<'hlx, 'a, R>
impl<'hlx, 'a, R: for<'de> Deserialize<'de>> QueryExecutionRequest<'hlx, 'a, R>
Sourcepub async fn send(self) -> Result<R, HelixError>
pub async fn send(self) -> Result<R, HelixError>
Send the request and deserialize the response body into R.
Sends the request to /v2/query, applies the toggled headers and bearer
API key, and awaits the response.
§Errors
HelixError::ReqwestErrorfor transport failures.HelixError::RemoteErrorfor any non-200response (carrying the server’s body or status reason).HelixError::SerializationErrorif the request payload cannot be serialized or the response body cannot be deserialized intoR.
§Examples
#![recursion_limit = "256"]
use helix_db::Client;
use helix_db::dsl::prelude::*;
use serde::Deserialize;
#[derive(Deserialize)]
struct AddUserResponse { user_id: u64 }
let response: AddUserResponse = client.query(request).send().await?;Auto Trait Implementations§
impl<'hlx, 'a, R> !RefUnwindSafe for QueryExecutionRequest<'hlx, 'a, R>
impl<'hlx, 'a, R> !UnwindSafe for QueryExecutionRequest<'hlx, 'a, R>
impl<'hlx, 'a, R> Freeze for QueryExecutionRequest<'hlx, 'a, R>
impl<'hlx, 'a, R> Send for QueryExecutionRequest<'hlx, 'a, R>where
R: Send,
impl<'hlx, 'a, R> Sync for QueryExecutionRequest<'hlx, 'a, R>where
R: Sync,
impl<'hlx, 'a, R> Unpin for QueryExecutionRequest<'hlx, 'a, R>where
R: Unpin,
impl<'hlx, 'a, R> UnsafeUnpin for QueryExecutionRequest<'hlx, 'a, R>
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