Skip to main content

QueryRequest

Struct QueryRequest 

Source
pub struct QueryRequest<C, R, T = Vec<R>> { /* private fields */ }
Expand description

A QueryDefinition applied to its arguments: what Zero::materialize, run, and preload take, which build it with the client’s context. It is Send, so an app can make one on one thread for a client on another.

Implementations§

Source§

impl<C, R, T> QueryRequest<C, R, T>

Source

pub fn name(&self) -> &'static str

The query’s name.

Source

pub fn args(&self) -> &[Value]

The arguments as sent: none, or one JSON value.

Source

pub fn query(&self, context: &C) -> Query<R, T>

The query as context sees it, named so the server knows it.

Source§

impl<C, R, T: QueryValue> QueryRequest<C, R, T>

Source

pub fn read(&self, view: &ViewValue) -> Result<T, ZeroValueError>

Reads a view of this query as its result, as Query::read does.

Trait Implementations§

Source§

impl<C, R, T> Clone for QueryRequest<C, R, T>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<C, R, T> ZeroQuery<C> for QueryRequest<C, R, T>

Source§

fn any_query(&self, context: &C) -> Cow<'_, AnyQuery>

The query, as context sees it.

Auto Trait Implementations§

§

impl<C, R, T = Vec<R>> !RefUnwindSafe for QueryRequest<C, R, T>

§

impl<C, R, T = Vec<R>> !UnwindSafe for QueryRequest<C, R, T>

§

impl<C, R, T> Forget for QueryRequest<C, R, T>

§

impl<C, R, T> Freeze for QueryRequest<C, R, T>
where Arc<dyn Fn(&C) -> Query<R, T> + Send + Sync>: Freeze,

§

impl<C, R, T> Move for QueryRequest<C, R, T>

§

impl<C, R, T> Send for QueryRequest<C, R, T>
where Arc<dyn Fn(&C) -> Query<R, T> + Send + Sync>: Send,

§

impl<C, R, T> Sync for QueryRequest<C, R, T>
where Arc<dyn Fn(&C) -> Query<R, T> + Send + Sync>: Sync,

§

impl<C, R, T> Unpin for QueryRequest<C, R, T>
where Arc<dyn Fn(&C) -> Query<R, T> + Send + Sync>: Unpin,

§

impl<C, R, T> UnsafeUnpin for QueryRequest<C, R, T>
where Arc<dyn Fn(&C) -> Query<R, T> + Send + Sync>: UnsafeUnpin,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.