pub struct EntryDelta<K, V> {
pub add: Vec<(K, V)>,
pub remove: Vec<K>,
}Expand description
A membership diff between two collections of key/value entries.
The two parts are asymmetric, and the map’s one-value-per-key rule is what
makes them so: add carries whole entries because the receiver needs to
be told the value, while remove carries bare keys because a key names
an entry on its own.
A key that survived with a new value under it is an add, not a removal
followed by one. Applying an addition overwrites whatever the key held, so
the removal would say nothing the addition does not already say.
Nothing here records position — see SeqDelta for that.
Fields§
§add: Vec<(K, V)>What a key holds in the new collection that it did not hold in the old one — both keys that arrived and keys whose value moved.
remove: Vec<K>Keys that were in the old collection but are not in the new one.
Implementations§
Trait Implementations§
Source§impl<K: Clone, V: Clone> Clone for EntryDelta<K, V>
impl<K: Clone, V: Clone> Clone for EntryDelta<K, V>
Source§fn clone(&self) -> EntryDelta<K, V>
fn clone(&self) -> EntryDelta<K, V>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more