Skip to main content

CollectionEntry

Trait CollectionEntry 

Source
pub trait CollectionEntry: CollectionMap {
    type Entry<'a>: MapEntry<'a, Key = Self::Key, Value = Self::Value>
       where Self: 'a;

    // Required method
    fn entry(&mut self, key: Self::Key) -> Self::Entry<'_>;
}
Expand description

Trait implemented by maps that expose an in-place entry API.

Required Associated Types§

Source

type Entry<'a>: MapEntry<'a, Key = Self::Key, Value = Self::Value>
where Self: 'a,

Native entry type used for in-place map operations.

Required Methods§

Source

fn entry(&mut self, key: Self::Key) -> Self::Entry<'_>

Gets the given key’s corresponding entry in the map for in-place manipulation.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<K: Eq + Hash, V, S: BuildHasher, A: Allocator> CollectionEntry for HashMap<K, V, S, A>

Available on crate feature hashbrown only.
Source§

type Entry<'a> = Entry<'a, K, V, S, A>
where K: 'a, V: 'a, S: 'a, A: 'a,

Source§

fn entry(&mut self, key: Self::Key) -> Self::Entry<'_>

Source§

impl<K: Eq + Hash, V, S: BuildHasher, const N: usize> CollectionEntry for IndexMap<K, V, S, N>

Available on crate feature heapless only.
Source§

type Entry<'a> = Entry<'a, K, V, N>
where K: 'a, V: 'a, S: 'a,

Source§

fn entry(&mut self, key: Self::Key) -> Self::Entry<'_>

Source§

impl<K: Eq + Hash, V, S: BuildHasher> CollectionEntry for HashMap<K, V, S>

Available on crate feature std only.
Source§

type Entry<'a> = Entry<'a, K, V>
where K: 'a, V: 'a, S: 'a,

Source§

fn entry(&mut self, key: Self::Key) -> Self::Entry<'_>

Source§

impl<K: Eq + Hash, V, S: BuildHasher> CollectionEntry for IndexMap<K, V, S>

Available on crate feature indexmap only.
Source§

type Entry<'a> = Entry<'a, K, V>
where K: 'a, V: 'a, S: 'a,

Source§

fn entry(&mut self, key: Self::Key) -> Self::Entry<'_>

Source§

impl<K: Ord, V> CollectionEntry for BTreeMap<K, V>

Available on crate feature alloc only.
Source§

type Entry<'a> = Entry<'a, K, V>
where K: 'a, V: 'a,

Source§

fn entry(&mut self, key: Self::Key) -> Self::Entry<'_>

Implementors§