pub struct Differ { /* private fields */ }Expand description
Calculates diffs between arrays of QueryResultItems.
Use a Differ with a
StoreObserver to get the diff
between subsequent query results delivered by the store observer.
Implementations§
Source§impl Differ
impl Differ
Sourcepub fn diff(&self, items: impl IntoIterator<Item = QueryResultItem>) -> Diff
pub fn diff(&self, items: impl IntoIterator<Item = QueryResultItem>) -> Diff
Calculate the diff of the provided items against the last set of items that were passed to this differ.
The returned Diff identifies changes from the old array of items
to the new array of items using indices into both arrays.
Initially, the differ has no items, so the first call to this method will always return a diff showing all items as insertions.
The identity of items is determined by their _id field.
itemsThe query result items to compare against the last array of items.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Differ
impl RefUnwindSafe for Differ
impl Send for Differ
impl Sync for Differ
impl Unpin for Differ
impl UnwindSafe for Differ
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more