pub struct PendingIdSpecificOperation { /* private fields */ }
Expand description

These objects are returned when using find_by_id functionality on DittoCollections. You can either call exec on the object to get an immediate return value, or you can establish either a live query or a subscription, which both work over time. A live query, established by calling observe_local, will notify you every time there’s an update to the document with the ID you provided in the preceding find_by_id call. A subscription, established by calling subscribe, will act as a signal to other peers that you would like to receive updates from them about the document with the ID you provided in the preceding find_by_id call. Update and remove functionality is also exposed through this object.

Implementations

Enables you to subscribe to changes that occur in relation to a document. Having a subscription acts as a signal to other peers that you are interested in receiving updates when local or remote changes are made to the relevant document. The returned DittoSubscription object must be kept in scope for as long as you want to keep receiving updates.

Panics

Panics if Ditto has been closed.

Remove the document with the matching ID.

Evict the document with the matching ID.

Execute the find operation to return the document with the matching ID.

Enables you to listen for changes that occur in relation to a document. This won’t subscribe to receive changes made remotely by others and so it will only fire updates when a local change is made. If you want to receive remotely performed updates as well then use observe or also call subscribe separately after another find_by_id call that references the same document ID.

The returned LiveQuery object must be kept in scope for as long as you want the provided handler to be called when an update occurs.

Update the document with the matching ID.

  • updater - a Fn which will be called on the selected document if found

Replaces the matching document with the provided value

  • new_value - A new Serializable which will replace the found document Note this actually follows “upsert” rules and will insert a document if no document is found with the given DocumentId.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Converts to T by calling Into<T>::into.
Tries to convert to T by calling TryInto<T>::try_into.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.