pub struct ReconfigurableLiveQuery<Q, T, E> { /* private fields */ }Expand description
A subscription whose request may be replaced while it runs. Its results
fail with E, the query closure’s own error type.
Implementations§
Source§impl<Q, T, E> ReconfigurableLiveQuery<Q, T, E>
impl<Q, T, E> ReconfigurableLiveQuery<Q, T, E>
Sourcepub fn runs(&self) -> LiveQueryRuns
pub fn runs(&self) -> LiveQueryRuns
How often this query has run so far, its processed form’s runs too.
Sourcepub fn is_marked_for_rerun(&self) -> bool
pub fn is_marked_for_rerun(&self) -> bool
Whether a commit since this idle query’s last result changes what it reads, so asking for its next result runs it again. A commit marks the queries it changes as it commits, so this answers with no waiting.
Sourcepub fn requests(&self) -> LiveQueryRequests<Q>
pub fn requests(&self) -> LiveQueryRequests<Q>
Obtain a cloneable handle for replacing this query’s request.
Sourcepub fn process<P, U>(self, process: P) -> ReconfigurableLiveQuery<Q, U, E>
pub fn process<P, U>(self, process: P) -> ReconfigurableLiveQuery<Q, U, E>
Process each value on a worker after releasing the connection. Equality compares processed values; request handles and event metadata remain.
Sourcepub async fn next(&mut self) -> Option<ReconfigurableLiveQueryEvent<Q, T, E>>
pub async fn next(&mut self) -> Option<ReconfigurableLiveQueryEvent<Q, T, E>>
Return the next result and its request. Cancelling this wait retains the
in-flight run, so its request revision is not lost. Once the store is
closed, or the handle fails every call, one result reports why and
every later call returns None. So does a run whose error carries a
bug, as one that panicked does with DbError::Bug: what it read is
unknown, so no commit could tell whether to run it again (E15).