pub struct EmptyCommonality(/* private fields */);
Expand description
A commonality for collection types, where the common value is an empty collection.
In most cases, this commonality behaves the same as DefaultCommonality because typical collection types’ implementations of Default::default yield empty collections. However, this commonality avoids the need for PartialEq bounds on the collection type.
Trait Implementations§
Source§impl<K, V> Commonality<BTreeMap<K, V>> for EmptyCommonality
impl<K, V> Commonality<BTreeMap<K, V>> for EmptyCommonality
Source§impl<T> Commonality<BTreeSet<T>> for EmptyCommonality
impl<T> Commonality<BTreeSet<T>> for EmptyCommonality
Source§impl<K, V> Commonality<HashMap<K, V>> for EmptyCommonality
impl<K, V> Commonality<HashMap<K, V>> for EmptyCommonality
Source§impl<T> Commonality<HashSet<T>> for EmptyCommonality
impl<T> Commonality<HashSet<T>> for EmptyCommonality
Source§impl<K, V, C: Commonality<V>> Commonality<TotalBTreeMap<K, V, C>> for EmptyCommonality
impl<K, V, C: Commonality<V>> Commonality<TotalBTreeMap<K, V, C>> for EmptyCommonality
Source§fn common() -> TotalBTreeMap<K, V, C>
fn common() -> TotalBTreeMap<K, V, C>
The common value of type
V
.Source§fn is_common(value: &TotalBTreeMap<K, V, C>) -> bool
fn is_common(value: &TotalBTreeMap<K, V, C>) -> bool
Returns true if
value
is the common value of type V
. Self::is_common(Self::common())
must be true.Source§impl<K, V, C: Commonality<V>> Commonality<TotalHashMap<K, V, C>> for EmptyCommonality
impl<K, V, C: Commonality<V>> Commonality<TotalHashMap<K, V, C>> for EmptyCommonality
Source§fn common() -> TotalHashMap<K, V, C>
fn common() -> TotalHashMap<K, V, C>
The common value of type
V
.Source§fn is_common(value: &TotalHashMap<K, V, C>) -> bool
fn is_common(value: &TotalHashMap<K, V, C>) -> bool
Returns true if
value
is the common value of type V
. Self::is_common(Self::common())
must be true.Source§impl<T> Commonality<Vec<T>> for EmptyCommonality
impl<T> Commonality<Vec<T>> for EmptyCommonality
Auto Trait Implementations§
impl Freeze for EmptyCommonality
impl RefUnwindSafe for EmptyCommonality
impl Send for EmptyCommonality
impl Sync for EmptyCommonality
impl Unpin for EmptyCommonality
impl UnwindSafe for EmptyCommonality
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