pub trait MergeCollection<Key, Value> {
// Required method
fn merge_collection(
self,
other: impl IntoIterator<Item = (Key, Value)>,
action: impl Fn(Value, Value) -> Value,
) -> Self;
}Required Methods§
Sourcefn merge_collection(
self,
other: impl IntoIterator<Item = (Key, Value)>,
action: impl Fn(Value, Value) -> Value,
) -> Self
fn merge_collection( self, other: impl IntoIterator<Item = (Key, Value)>, action: impl Fn(Value, Value) -> Value, ) -> Self
Returns a collection which contains the combination by using action of the values from the
given two collections, for each key.
If the key is missing from one of them, it is treated as zero.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
impl<Key: Eq, Value: HasZero + Clone + Eq> MergeCollection<Key, Value> for SmallOrderedMap<Key, Value>
Available on crate feature
std only.