Type Alias bevy_utils::Entry
source · pub type Entry<'a, K, V> = Entry<'a, K, V, BuildHasherDefault<AHasher>>;
Expand description
A shortcut alias for hashbrown::hash_map::Entry
.
Aliased Type§
enum Entry<'a, K, V> {
Occupied(OccupiedEntry<'a, K, V>),
Vacant(VacantEntry<'a, K, V>),
}
Variants§
Occupied(OccupiedEntry<'a, K, V>)
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>)
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(_) => { }
}