doc.rust-lang.org
pub fn is_disjoint(&self, other: &HashSet<T, S, A>) -> bool
Returns true if self has no elements in common with other. This is equivalent to checking for an empty intersection.
method
std
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn intersection<'a>(&'a self, other: &'a HashSet<T, S, A>) -> Intersection<'a, T, S, A>
Visits the values representing the intersection, i.e., the values that are both in self and other.
method
std
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn insert(&mut self, value: T) -> bool
Adds a value to the set.
method
std
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn hasher(&self) -> &S
Returns a reference to the set's BuildHasher.
method
std
Stable since 1.9.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn get<Q>(&self, value: &Q) -> Option<&T>
Returns a reference to the value in the set, if any, that is equal to the given value.
method
std
Stable since 1.9.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn extract_if<F>(&mut self, pred: F) -> ExtractIf<'_, T, F, A>
Creates an iterator which uses a closure to determine if an element should be removed.
method
std
Stable since 1.88.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn drain(&mut self) -> Drain<'_, T, A>
Clears the set, returning all elements as an iterator. Keeps the allocated memory for reuse.
method
std
Stable since 1.6.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn difference<'a>(&'a self, other: &'a HashSet<T, S, A>) -> Difference<'a, T, S, A>
Visits the values representing the difference, i.e., the values that are in self but not in other.
method
std
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn contains<Q>(&self, value: &Q) -> bool
Returns true if the set contains a value.
method
std
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn clear(&mut self)
Clears the set, removing all values.
method
std
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn capacity(&self) -> usize
Returns the number of elements the set can hold without reallocating.
method
std
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub struct HashSet<T, S, A>
A hash set implemented as a HashMap where the value is ().
struct
std
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub struct ExtractIf<'a, K, F, A>
A draining, filtering iterator over the items of a HashSet.
struct
std
Stable since 1.88.0
Version 1.100.0-nightly
doc.rust-lang.org
pub struct Drain<'a, K, A>
A draining iterator over the items of a HashSet.
struct
std
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub struct Difference<'a, T, S, A>
A lazy iterator producing elements in the difference of HashSets.
struct
std
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub struct ValuesMut<'a, K, V>
A mutable iterator over the values of a HashMap.
struct
std
Stable since 1.10.0
Version 1.100.0-nightly
doc.rust-lang.org
pub struct Values<'a, K, V>
An iterator over the values of a HashMap.
struct
std
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn key(&self) -> &K
Gets a reference to the key that would be used when inserting a value through the VacantEntry.
method
std
Stable since 1.10.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn into_key(self) -> K
Take ownership of the key.
method
std
Stable since 1.12.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn insert_entry(self, value: V) -> OccupiedEntry<'a, K, V, A>
Sets the value of the entry with the VacantEntry's key, and returns an OccupiedEntry.
method
std
Stable since 1.83.0
Version 1.100.0-nightly