Struct dittolive_ditto::store::live_query::LiveQuery
source · [−]pub struct LiveQuery {
pub query: Box,
pub collection_name: Box,
pub subscription: Option<Box<Subscription>>,
pub id: i64,
/* private fields */
}
Expand description
The type that is returned when calling when calling observe_local
on a
DittoPendingCursorOperation
object. It handles the logic for calling the event handler that is
provided to observe_local
calls. LiveQuery
objects must be kept in scope for as long as you
wish to have your event handler be called when there is an update to a document matching the
query you provide.
Fields
query: Box
collection_name: Box
subscription: Option<Box<Subscription>>
id: i64
Implementations
sourceimpl LiveQuery
impl LiveQuery
pub fn with_handler<F>(
ditto: Weak<BoxedDitto>,
query: Box,
query_args: Option<Vec<u8>>,
collection_name: Box,
order_by: &[COrderByParam<'_>],
limit: i32,
offset: u32,
event_handler: F
) -> Result<Self, DittoError>where
F: EventHandler,
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for LiveQuery
impl Send for LiveQuery
impl Sync for LiveQuery
impl Unpin for LiveQuery
impl UnwindSafe for LiveQuery
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> CompatExt for T
impl<T> CompatExt for T
fn compat_ref(&self) -> Compat<&T>
fn compat_ref(&self) -> Compat<&T>
Applies the [
Compat
] adapter by shared reference. Read morefn compat_mut(&mut self) -> Compat<&mut T>
fn compat_mut(&mut self) -> Compat<&mut T>
Applies the [
Compat
] adapter by mutable reference. Read more