pub struct HashSet<T, S = RandomState> { /* private fields */ }Expand description
A wrapper type around [hashbrown::hash_set::HashSet] that only exposes
fallible allocation.
Implementations§
Source§impl<T> HashSet<T, RandomState>
impl<T> HashSet<T, RandomState>
Source§impl<T> HashSet<T, RandomState>
impl<T> HashSet<T, RandomState>
Sourcepub fn with_capacity(capacity: usize) -> Result<Self, OutOfMemory>
pub fn with_capacity(capacity: usize) -> Result<Self, OutOfMemory>
Same as [hashbrown::hash_set::HashSet::with_capacity] but returns an
error on allocation failure.
Source§impl<T, S> HashSet<T, S>
impl<T, S> HashSet<T, S>
Sourcepub const fn with_hasher(hasher: S) -> Self
pub const fn with_hasher(hasher: S) -> Self
Same as [hashbrown::hash_set::HashSet::with_hasher].
Sourcepub fn extract_if<F>(&mut self, f: F) -> ExtractIf<'_, T, F> ⓘ
pub fn extract_if<F>(&mut self, f: F) -> ExtractIf<'_, T, F> ⓘ
Same as [hashbrown::hash_set::HashSet::extract_if].
Source§impl<T, S> HashSet<T, S>
impl<T, S> HashSet<T, S>
Sourcepub fn with_capacity_and_hasher(
capacity: usize,
hasher: S,
) -> Result<Self, OutOfMemory>
pub fn with_capacity_and_hasher( capacity: usize, hasher: S, ) -> Result<Self, OutOfMemory>
Same as [hashbrown::hash_set::HashSet::with_capacity_and_hasher] but
returns an error on allocation failure.
Sourcepub fn reserve(&mut self, additional: usize) -> Result<(), OutOfMemory>
pub fn reserve(&mut self, additional: usize) -> Result<(), OutOfMemory>
Same as [hashbrown::hash_set::HashSet::reserve] but returns an error
on allocation failure.
Sourcepub fn insert(&mut self, value: T) -> Result<bool, OutOfMemory>
pub fn insert(&mut self, value: T) -> Result<bool, OutOfMemory>
Same as [hashbrown::hash_set::HashSet::insert] but returns an error on
allocation failure.
Trait Implementations§
impl<T, S> Eq for HashSet<T, S>
Auto Trait Implementations§
impl<T, S> Freeze for HashSet<T, S>where
S: Freeze,
impl<T, S> RefUnwindSafe for HashSet<T, S>where
S: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, S> Send for HashSet<T, S>
impl<T, S> Sync for HashSet<T, S>
impl<T, S> Unpin for HashSet<T, S>
impl<T, S> UnwindSafe for HashSet<T, S>where
S: UnwindSafe,
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more