SubCollection

Trait SubCollection 

Source
pub trait SubCollection<Key, Value> {
    // Required method
    fn sub_collection(
        self,
        other: impl IntoIterator<Item = (Key, Value)>,
    ) -> Self;
}
Expand description

A trait for types which support subtraction on collections.

Required Methods§

Source

fn sub_collection(self, other: impl IntoIterator<Item = (Key, Value)>) -> Self

Returns a new collection with the difference 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§

Source§

impl<Key, Value: Sub<Output = Value>, T: MergeCollection<Key, Value>> SubCollection<Key, Value> for T