Trait GetEntry

Source
pub trait GetEntry<'a>: GetMut {
    type Occupied: OccupiedEntry<'a, Self>;
    type Vacant: VacantEntry<'a, Self>;

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

A trait for getting an entry at a given key.

Required Associated Types§

Source

type Occupied: OccupiedEntry<'a, Self>

The type of an occupied entry.

Source

type Vacant: VacantEntry<'a, Self>

The type of a vacant entry.

Required Methods§

Source

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

Gets the entry.

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<'a, K: 'a + Ord, V: 'a> GetEntry<'a> for BTreeMap<K, V>

Source§

type Occupied = OccupiedEntry<'a, K, V>

Source§

type Vacant = VacantEntry<'a, K, V>

Source§

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

Source§

impl<'a, K: 'a + Hash + Eq, V: 'a> GetEntry<'a> for HashMap<K, V>

Source§

type Occupied = OccupiedEntry<'a, K, V>

Source§

type Vacant = VacantEntry<'a, K, V>

Source§

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

Implementors§