Enum dittolive_ditto::prelude::LiveQueryEvent
source · [−]pub enum LiveQueryEvent {
Initial,
Update {
old_documents: Vec<BoxedDocument>,
insertions: Box<[usize]>,
deletions: Box<[usize]>,
updates: Box<[usize]>,
moves: Vec<LiveQueryMove>,
},
}
Expand description
Describes the different types of event that you can receive when dealing with live queries.
Variants
Initial
The first event that will be delivered and it will only be delivered once.
Update
This event will be delivered each time the results of the provided query change. It contains information about the set of documents that previously matched the query before the update, along with information about what documents have been inserted, deleted, updated, or moved, as part of the set of matching documents.
Implementations
sourceimpl LiveQueryEvent
impl LiveQueryEvent
sourcepub fn hash(&self, docs: &[BoxedDocument]) -> Result<u64, DittoError>
pub fn hash(&self, docs: &[BoxedDocument]) -> Result<u64, DittoError>
Return an hash of a document
sourcepub fn hash_mnemonic(&self, docs: &[BoxedDocument]) -> Result<String, DittoError>
pub fn hash_mnemonic(&self, docs: &[BoxedDocument]) -> Result<String, DittoError>
Return the hash the Document
s mnemonic.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for LiveQueryEvent
impl Send for LiveQueryEvent
impl Sync for LiveQueryEvent
impl Unpin for LiveQueryEvent
impl UnwindSafe for LiveQueryEvent
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