Type Alias bevy_utils::Entry

source ·
pub type Entry<'a, K, V, S = BuildHasherDefault<AHasher>> = Entry<'a, K, V, S>;
Expand description

A shortcut alias for hashbrown::hash_map::Entry.

Aliased Type§

enum Entry<'a, K, V, S = BuildHasherDefault<AHasher>> {
    Occupied(OccupiedEntry<'a, K, V, S>),
    Vacant(VacantEntry<'a, K, V, S>),
}

Variants§

§

Occupied(OccupiedEntry<'a, K, V, S>)

An occupied entry.

§Examples

use hashbrown::hash_map::{Entry, HashMap};
let mut map: HashMap<_, _> = [("a", 100), ("b", 200)].into();

match map.entry("a") {
    Entry::Vacant(_) => unreachable!(),
    Entry::Occupied(_) => { }
}
§

Vacant(VacantEntry<'a, K, V, S>)

A vacant entry.

§Examples

use hashbrown::hash_map::{Entry, HashMap};
let mut map: HashMap<&str, i32> = HashMap::new();

match map.entry("a") {
    Entry::Occupied(_) => unreachable!(),
    Entry::Vacant(_) => { }
}