Skip to main content

QuerySubscriptions

Struct QuerySubscriptions 

Source
pub struct QuerySubscriptions { /* private fields */ }
Expand description

The query subscriptions of one UI session.

Implementations§

Source§

impl QuerySubscriptions

Source

pub fn new() -> Self

Source

pub fn open( &mut self, window: impl Into<String>, query: usize, reads: Vec<usize>, ) -> u64

Start a subscription to query for window. Nothing is requested until request names the parameters.

Source

pub fn get(&self, id: u64) -> Option<&QuerySubscription>

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Source

pub fn request(&mut self, id: u64, params: Vec<Value>) -> Option<Ticket>

Request new parameters; the previous request is cancelled. None when the subscription has ended.

Source

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

Apply an answer if it is still current.

Source

pub fn close(&mut self, id: u64) -> bool

End a subscription; its request in flight is cancelled.

Source

pub fn close_window(&mut self, window: &str) -> Vec<u64>

End every subscription of a closed window instance.

Source

pub fn refresh(&mut self, changed: &[usize]) -> Vec<(u64, Ticket, Vec<Value>)>

Engine state fields changed: every requested subscription whose query reads one of them is requested again with its parameters. Returns what to send to the provider.

Trait Implementations§

Source§

impl Debug for QuerySubscriptions

Source§

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

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

impl Default for QuerySubscriptions

Source§

fn default() -> Self

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

Auto Trait Implementations§

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.