pub struct Remote<'f, S> { /* private fields */ }Expand description
Queries and commands, in views: see the module docs.
An extractor: add a remote: Remote<'_, AppState> argument to any view. It is Copy.
Implementations§
Source§impl<'f, S: Clone + 'static> Remote<'f, S>
impl<'f, S: Clone + 'static> Remote<'f, S>
Sourcepub fn query<Q: Query<S>>(&self, query: Q) -> QueryState<Q::Output>
pub fn query<Q: Query<S>>(&self, query: Q) -> QueryState<Q::Output>
Reads query, running it if it isn’t cached. Call it every frame you show the result:
a query no view reads during a frame is dropped.
Sourcepub fn refresh<Q: Query<S>>(&self, query: &Q)
pub fn refresh<Q: Query<S>>(&self, query: &Q)
Reruns query the next time it is read. To rerun every query that depends on some data,
invalidate it instead.
Sourcepub fn command<C: Command<S>>(&self) -> CommandHandle<'f, S, C>
pub fn command<C: Command<S>>(&self) -> CommandHandle<'f, S, C>
The view’s handle to the command C: to run it, and to see whether it’s running and
what it returned.
Its state belongs to the view, for as long as its page (or layout) is shown. A command still running when the page is left completes and refreshes what it changed, but its output is dropped.
Trait Implementations§
Auto Trait Implementations§
impl<'f, S> !RefUnwindSafe for Remote<'f, S>
impl<'f, S> !Send for Remote<'f, S>
impl<'f, S> !Sync for Remote<'f, S>
impl<'f, S> !UnwindSafe for Remote<'f, S>
impl<'f, S> Freeze for Remote<'f, S>
impl<'f, S> Unpin for Remote<'f, S>
impl<'f, S> UnsafeUnpin for Remote<'f, S>where
&'f S: UnsafeUnpin,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more