Skip to main content

Query

Struct Query 

Source
pub struct Query<P, T> { /* private fields */ }
Expand description

One query subscription with its parameter versions.

Implementations§

Source§

impl<P: Clone, T: Clone> Query<P, T>

Source

pub fn new() -> Self

Source

pub fn state(&self) -> &Resource<T>

Source

pub fn params(&self) -> Option<&P>

Source

pub fn version(&self) -> u64

Version of the current parameters.

Source

pub fn discarded(&self) -> u64

Results that arrived too late and were dropped.

Source

pub fn request(&mut self, params: P) -> Ticket

Ask for params. The previous request is cancelled; data already shown stays visible while the new request loads.

Source

pub fn resolve( &mut self, ticket: &Ticket, result: Result<T, CommandError>, ) -> Resolution

A provider answered ticket. Only the current version is applied.

Source

pub fn end(&mut self)

The owner of the subscription ended, for example its page closed. The request in flight is cancelled and later results are dropped.

Trait Implementations§

Source§

impl<P: Debug, T: Debug> Debug for Query<P, T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<P, T> Default for Query<P, T>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<P, T> Freeze for Query<P, T>
where Option<P>: Freeze, Resource<T>: Freeze,

§

impl<P, T> RefUnwindSafe for Query<P, T>

§

impl<P, T> Send for Query<P, T>
where Option<P>: Send, Resource<T>: Send,

§

impl<P, T> Sync for Query<P, T>
where Option<P>: Sync, Resource<T>: Sync,

§

impl<P, T> Unpin for Query<P, T>
where Option<P>: Unpin, Resource<T>: Unpin,

§

impl<P, T> UnsafeUnpin for Query<P, T>

§

impl<P, T> UnwindSafe for Query<P, T>

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> 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, 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.