zng_unique_id

Type Alias IdEntry

source
pub type IdEntry<'a, K, V> = Entry<'a, K, V, BuildIdHasher>;
Expand description

Entry in IdMap.

Aliased Type§

enum IdEntry<'a, K, V> {
    Occupied(OccupiedEntry<'a, K, V, BuildIdHasher>),
    Vacant(VacantEntry<'a, K, V, BuildIdHasher>),
}

Variants§

§

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

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, BuildIdHasher>)

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(_) => { }
}