Struct EmptyCommonality

Source
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

Source§

fn common() -> BTreeMap<K, V>

The common value of type V.
Source§

fn is_common(value: &BTreeMap<K, V>) -> bool

Returns true if value is the common value of type V. Self::is_common(Self::common()) must be true.
Source§

impl<T> Commonality<BTreeSet<T>> for EmptyCommonality

Source§

fn common() -> BTreeSet<T>

The common value of type V.
Source§

fn is_common(value: &BTreeSet<T>) -> bool

Returns true if value is the common value of type V. Self::is_common(Self::common()) must be true.
Source§

impl<K, V> Commonality<HashMap<K, V>> for EmptyCommonality

Source§

fn common() -> HashMap<K, V>

The common value of type V.
Source§

fn is_common(value: &HashMap<K, V>) -> bool

Returns true if value is the common value of type V. Self::is_common(Self::common()) must be true.
Source§

impl<T> Commonality<HashSet<T>> for EmptyCommonality

Source§

fn common() -> HashSet<T>

The common value of type V.
Source§

fn is_common(value: &HashSet<T>) -> 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<TotalBTreeMap<K, V, C>> for EmptyCommonality

Source§

fn common() -> TotalBTreeMap<K, V, C>

The common value of type V.
Source§

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

Source§

fn common() -> TotalHashMap<K, V, C>

The common value of type V.
Source§

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

Source§

fn common() -> Vec<T>

The common value of type V.
Source§

fn is_common(value: &Vec<T>) -> bool

Returns true if value is the common value of type V. Self::is_common(Self::common()) must be true.
Source§

impl<T> Commonality<VecDeque<T>> for EmptyCommonality

Source§

fn common() -> VecDeque<T>

The common value of type V.
Source§

fn is_common(value: &VecDeque<T>) -> bool

Returns true if value is the common value of type V. Self::is_common(Self::common()) must be true.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.