Type Alias Entry

Source
pub type Entry<'a, T, S = FixedHasher> = Entry<'a, T, S>;
Expand description

Shortcut for Entry with FixedHasher as the default hashing provider.

Aliased Type§

enum Entry<'a, T, S = FixedHasher> {
    Occupied(OccupiedEntry<'a, T, S>),
    Vacant(VacantEntry<'a, T, S>),
}

Variants§

§

Occupied(OccupiedEntry<'a, T, S>)

An occupied entry.

§Examples

use hashbrown::hash_set::{Entry, HashSet};
let mut set: HashSet<_> = ["a", "b"].into();

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

Vacant(VacantEntry<'a, T, S>)

A vacant entry.

§Examples

use hashbrown::hash_set::{Entry, HashSet};
let mut set: HashSet<&str> = HashSet::new();

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