pub struct CollectionsEvent {
pub is_initial: bool,
pub collections: Vec<Collection>,
pub old_collections: Vec<Collection>,
pub insertions: Box<[usize]>,
pub deletions: Box<[usize]>,
pub updates: Box<[usize]>,
pub moves: Vec<LiveQueryMove>,
}Expand description
Use ditto.store().collections().observe_local(...) to receive CollectionsEvents.
A CollectionsEvent describes one or more changes to a Ditto Collection.
Provides information about the changes that have occurred in relation to an event delivered when observing the collections in a Ditto store. It contains information about the collections that are known about as well as the collections that were previously known about in the previous event, along with information about what collections have been inserted, deleted, updated, or moved since the last event.
Fields§
§is_initial: boolWhether this event is the first one delivered to a particular observer.
collections: Vec<Collection>A list of known collections at the time of this event.
old_collections: Vec<Collection>A list of known collections at the time of the previous event.
insertions: Box<[usize]>A list of indices into collections of newly-inserted collections.
deletions: Box<[usize]>A list of indices into old_collections of previously-known collections that have
been removed.
updates: Box<[usize]>A list of indices into collections of known updated collections.
moves: Vec<LiveQueryMove>Pairs of indices (from and to) describing collections that were previously located
in old_collections at the from index and are newly located in collections at the to
index.