MapProperties

Trait MapProperties 

Source
pub trait MapProperties {
    type Key;
    type Value;

    // Required methods
    fn keys_property(&self) -> impl Iterator<Item = &Self::Key>;
    fn values_property(&self) -> impl Iterator<Item = &Self::Value>;
    fn entries_property(
        &self,
    ) -> impl Iterator<Item = (&Self::Key, &Self::Value)>;
}
Expand description

The properties of a map-like type.

Required Associated Types§

Source

type Key

The type of the keys in this map.

Source

type Value

The type of the values in this map.

Required Methods§

Source

fn keys_property(&self) -> impl Iterator<Item = &Self::Key>

Returns an iterator over the keys in this map.

Source

fn values_property(&self) -> impl Iterator<Item = &Self::Value>

Returns an iterator over the values in this map.

Source

fn entries_property(&self) -> impl Iterator<Item = (&Self::Key, &Self::Value)>

Returns an iterator over the key/value-pairs in this map.

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.

Implementations on Foreign Types§

Source§

impl<K, V> MapProperties for &BTreeMap<K, V>

Source§

type Key = K

Source§

type Value = V

Source§

fn keys_property(&self) -> impl Iterator<Item = &<Self as MapProperties>::Key>

Source§

fn values_property(&self) -> impl Iterator<Item = &Self::Value>

Source§

fn entries_property(&self) -> impl Iterator<Item = (&Self::Key, &Self::Value)>

Source§

impl<K, V> MapProperties for &mut BTreeMap<K, V>

Source§

type Key = K

Source§

type Value = V

Source§

fn keys_property(&self) -> impl Iterator<Item = &<Self as MapProperties>::Key>

Source§

fn values_property(&self) -> impl Iterator<Item = &Self::Value>

Source§

fn entries_property(&self) -> impl Iterator<Item = (&Self::Key, &Self::Value)>

Source§

impl<K, V> MapProperties for BTreeMap<K, V>

Source§

type Key = K

Source§

type Value = V

Source§

fn keys_property(&self) -> impl Iterator<Item = &<Self as MapProperties>::Key>

Source§

fn values_property(&self) -> impl Iterator<Item = &Self::Value>

Source§

fn entries_property(&self) -> impl Iterator<Item = (&Self::Key, &Self::Value)>

Source§

impl<K, V, H> MapProperties for &HashMap<K, V, H>

Available on crate feature std only.
Source§

type Key = K

Source§

type Value = V

Source§

fn keys_property(&self) -> impl Iterator<Item = &<Self as MapProperties>::Key>

Source§

fn values_property(&self) -> impl Iterator<Item = &Self::Value>

Source§

fn entries_property(&self) -> impl Iterator<Item = (&Self::Key, &Self::Value)>

Source§

impl<K, V, H> MapProperties for &HashMap<K, V, H>

Source§

type Key = K

Source§

type Value = V

Source§

fn keys_property(&self) -> impl Iterator<Item = &<Self as MapProperties>::Key>

Source§

fn values_property(&self) -> impl Iterator<Item = &Self::Value>

Source§

fn entries_property(&self) -> impl Iterator<Item = (&Self::Key, &Self::Value)>

Source§

impl<K, V, H> MapProperties for &mut HashMap<K, V, H>

Available on crate feature std only.
Source§

type Key = K

Source§

type Value = V

Source§

fn keys_property(&self) -> impl Iterator<Item = &<Self as MapProperties>::Key>

Source§

fn values_property(&self) -> impl Iterator<Item = &Self::Value>

Source§

fn entries_property(&self) -> impl Iterator<Item = (&Self::Key, &Self::Value)>

Source§

impl<K, V, H> MapProperties for &mut HashMap<K, V, H>

Source§

type Key = K

Source§

type Value = V

Source§

fn keys_property(&self) -> impl Iterator<Item = &<Self as MapProperties>::Key>

Source§

fn values_property(&self) -> impl Iterator<Item = &Self::Value>

Source§

fn entries_property(&self) -> impl Iterator<Item = (&Self::Key, &Self::Value)>

Source§

impl<K, V, H> MapProperties for HashMap<K, V, H>

Available on crate feature std only.
Source§

type Key = K

Source§

type Value = V

Source§

fn keys_property(&self) -> impl Iterator<Item = &<Self as MapProperties>::Key>

Source§

fn values_property(&self) -> impl Iterator<Item = &Self::Value>

Source§

fn entries_property(&self) -> impl Iterator<Item = (&Self::Key, &Self::Value)>

Source§

impl<K, V, H> MapProperties for HashMap<K, V, H>

Source§

type Key = K

Source§

type Value = V

Source§

fn keys_property(&self) -> impl Iterator<Item = &<Self as MapProperties>::Key>

Source§

fn values_property(&self) -> impl Iterator<Item = &Self::Value>

Source§

fn entries_property(&self) -> impl Iterator<Item = (&Self::Key, &Self::Value)>

Implementors§