pub struct MapDelta<K, V, D> {
pub add: Vec<(K, V)>,
pub remove: Vec<K>,
pub change: Vec<KeyedDelta<K, D>>,
}Expand description
A keyed diff between two collections of entries.
The three parts are deliberately asymmetric, and that asymmetry is the
whole point of the field type: add carries whole entries because the
receiver has never seen them, while remove carries bare keys and
change carries deltas, because for those the receiver already holds the
rest.
Nothing here records position — see SeqDelta for that.
Fields§
§add: Vec<(K, V)>Entries whose keys are in the new collection but not the old one.
remove: Vec<K>Keys that were in the old collection but are not in the new one.
change: Vec<KeyedDelta<K, D>>Keys in both collections whose values differ, and how.
Implementations§
Trait Implementations§
Source§impl<'de, K, V, D> Deserialize<'de> for MapDelta<K, V, D>
impl<'de, K, V, D> Deserialize<'de> for MapDelta<K, V, D>
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl<K: Eq, V: Eq, D: Eq> Eq for MapDelta<K, V, D>
impl<K: PartialEq, V: PartialEq, D: PartialEq> StructuralPartialEq for MapDelta<K, V, D>
Auto Trait Implementations§
impl<K, V, D> Freeze for MapDelta<K, V, D>
impl<K, V, D> RefUnwindSafe for MapDelta<K, V, D>
impl<K, V, D> Send for MapDelta<K, V, D>
impl<K, V, D> Sync for MapDelta<K, V, D>
impl<K, V, D> Unpin for MapDelta<K, V, D>
impl<K, V, D> UnsafeUnpin for MapDelta<K, V, D>
impl<K, V, D> UnwindSafe for MapDelta<K, V, D>
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