Skip to main content

LiveQueryEvent

Enum LiveQueryEvent 

Source
pub enum LiveQueryEvent {
    Initial,
    Update {
        old_documents: Vec<BoxedDocument>,
        insertions: Box<[usize]>,
        deletions: Box<[usize]>,
        updates: Box<[usize]>,
        moves: Vec<LiveQueryMove>,
    },
}
👎Deprecated: Use ditto.store().execute_v2(...) or ditto.store().register_observer_v2(...) instead
Expand description

Use pending_op.observe_local(...) to receive LiveQueryEvents describing document changes.

Describes the different types of event that you can receive when dealing with live queries.

Variants§

§

Initial

👎Deprecated: Use ditto.store().execute_v2(...) or ditto.store().register_observer_v2(...) instead

The first event that will be delivered and it will only be delivered once.

§

Update

👎Deprecated: Use ditto.store().execute_v2(...) or ditto.store().register_observer_v2(...) instead

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.

Fields

§old_documents: Vec<BoxedDocument>
👎Deprecated: Use ditto.store().execute_v2(...) or ditto.store().register_observer_v2(...) instead
§insertions: Box<[usize]>
👎Deprecated: Use ditto.store().execute_v2(...) or ditto.store().register_observer_v2(...) instead
§deletions: Box<[usize]>
👎Deprecated: Use ditto.store().execute_v2(...) or ditto.store().register_observer_v2(...) instead
§updates: Box<[usize]>
👎Deprecated: Use ditto.store().execute_v2(...) or ditto.store().register_observer_v2(...) instead
§moves: Vec<LiveQueryMove>
👎Deprecated: Use ditto.store().execute_v2(...) or ditto.store().register_observer_v2(...) instead

Implementations§

Source§

impl LiveQueryEvent

Source

pub fn hash(&self, docs: &[BoxedDocument]) -> Result<u64, DittoError>

👎Deprecated: Use ditto.store().execute_v2(...) or ditto.store().register_observer_v2(...) instead

Return an hash of a document

Source

pub fn hash_mnemonic( &self, docs: &[BoxedDocument], ) -> Result<String, DittoError>

👎Deprecated: Use ditto.store().execute_v2(...) or ditto.store().register_observer_v2(...) instead

Return the hash the Documents mnemonic.

Trait Implementations§

Source§

impl Debug for LiveQueryEvent

Source§

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

Formats the value using the given formatter. 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> CompatExt for T

Source§

fn compat(self) -> Compat<T>

Applies the Compat adapter by value. Read more
Source§

fn compat_ref(&self) -> Compat<&T>

Applies the Compat adapter by shared reference. Read more
Source§

fn compat_mut(&mut self) -> Compat<&mut T>

Applies the Compat adapter by mutable reference. Read more
Source§

impl<T> FitForCArc for T

Source§

impl<T> FitForCBox for T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> ManuallyDropMut for T

Source§

type Ret = ManuallyDrop<T>

Source§

fn manually_drop_mut<'__>(&'__ mut self) -> &'__ mut ManuallyDrop<T>

Source§

impl<T> To for T
where T: ?Sized,

Source§

fn to<T>(self) -> T
where Self: Into<T>,

Converts to T by calling Into<T>::into.
Source§

fn try_to<T>(self) -> Result<T, Self::Error>
where Self: TryInto<T>,

Tries to convert to T by calling TryInto<T>::try_into.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<F> ZeroSizedElseWrathOfTheGඞds for F