#[non_exhaustive]pub struct Diff {
pub insertions: HashSet<usize>,
pub deletions: HashSet<usize>,
pub updates: HashSet<usize>,
pub moves: HashSet<DiffMove>,
}Expand description
Represents a diff between two arrays.
Create a diff between arrays of QueryResultItems using a Differ.
Alternatively, you can directly create a Diff via Diff::empty:
let mut diff = Diff::empty();
diff.insertions.extend([1, 2, 3]);Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.insertions: HashSet<usize>The set of indexes in the new array at which new items have been inserted.
deletions: HashSet<usize>The set of indexes in the old array at which old items have been deleted.
updates: HashSet<usize>The set of indexes in the new array at which items have been updated.
moves: HashSet<DiffMove>A set of tuples each representing a move of an item from a particular
index in the old array to a particular index in the new array.
Implementations§
Trait Implementations§
impl Eq for Diff
impl StructuralPartialEq for Diff
Auto Trait Implementations§
impl Freeze for Diff
impl RefUnwindSafe for Diff
impl Send for Diff
impl Sync for Diff
impl Unpin for Diff
impl UnwindSafe for Diff
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> CompatExt for T
impl<T> CompatExt for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more