[−][src]Struct flurry::HashSetRef
A reference to a HashSet
, constructed with HashSet::pin
or HashSet::with_guard
.
The current thread will be pinned for the duration of this reference. Keep in mind that this prevents the collection of garbage generated by the set.
Methods
impl<'_, T, S> HashSetRef<'_, T, S>
[src]
pub fn len(&self) -> usize
[src]
Returns the number of elements in the set.
See also HashSet::len
.
pub fn is_empty(&self) -> bool
[src]
Returns true
if the set is empty. Otherwise returns false
.
See also HashSet::is_empty
.
pub fn iter(&self) -> Keys<T, ()>
[src]
An iterator visiting all elements in arbitrary order.
The iterator element type is &'g T
.
See also HashSet::iter
.
impl<'_, T, S> HashSetRef<'_, T, S> where
T: Hash + Ord,
S: BuildHasher,
[src]
T: Hash + Ord,
S: BuildHasher,
pub fn contains<Q: ?Sized>(&self, value: &Q) -> bool where
T: Borrow<Q>,
Q: Hash + Ord,
[src]
T: Borrow<Q>,
Q: Hash + Ord,
Returns true
if the given value is an element of this set.
See also HashSet::contains
.
pub fn get<'g, Q: ?Sized>(&'g self, value: &Q) -> Option<&'g T> where
T: Borrow<Q>,
Q: Hash + Ord,
[src]
T: Borrow<Q>,
Q: Hash + Ord,
Returns a reference to the element in the set, if any, that is equal to the given value.
See also HashSet::get
.
pub fn is_disjoint(&self, other: &HashSetRef<T, S>) -> bool
[src]
Returns true
if self
has no elements in common with other
.
See also HashSet::is_disjoint
.
pub fn is_subset(&self, other: &HashSetRef<T, S>) -> bool
[src]
Returns true
if the set is a subset of another, i.e., other
contains at least all the values in self
.
See also HashSet::is_subset
.
pub fn is_superset<'other>(&self, other: &HashSetRef<'other, T, S>) -> bool
[src]
Returns true
if the set is a superset of another, i.e., self
contains at least all the values in other
.
See also HashSet::is_superset
.
impl<'_, T, S> HashSetRef<'_, T, S> where
T: 'static + Sync + Send + Clone + Hash + Ord,
S: BuildHasher,
[src]
T: 'static + Sync + Send + Clone + Hash + Ord,
S: BuildHasher,
pub fn insert(&self, value: T) -> bool
[src]
Adds a value to the set.
See also HashSet::insert
.
pub fn remove<Q: ?Sized>(&self, value: &Q) -> bool where
T: Borrow<Q>,
Q: Hash + Ord,
[src]
T: Borrow<Q>,
Q: Hash + Ord,
Removes a value from the set.
See also HashSet::remove
.
pub fn take<'g, Q: ?Sized>(&'g self, value: &Q) -> Option<&'g T> where
T: Borrow<Q>,
Q: Hash + Ord,
[src]
T: Borrow<Q>,
Q: Hash + Ord,
Removes and returns the value in the set, if any, that is equal to the given one.
See also HashSet::take
.
pub fn retain<F>(&self, f: F) where
F: FnMut(&T) -> bool,
[src]
F: FnMut(&T) -> bool,
Retains only the elements specified by the predicate.
See also HashSet::retain
.
impl<'_, T, S> HashSetRef<'_, T, S> where
T: Clone + Ord,
[src]
T: Clone + Ord,
pub fn clear(&self)
[src]
Clears the set, removing all elements.
See also HashSet::clear
.
pub fn reserve(&self, additional: usize)
[src]
Tries to reserve capacity for at least additional
more elements to
be inserted into the underlying HashSet
.
See also HashSet::reserve
.
Trait Implementations
impl<'_, T, S> Clone for HashSetRef<'_, T, S>
[src]
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<'_, T, S> Debug for HashSetRef<'_, T, S> where
T: Debug,
[src]
T: Debug,
impl<'_, T, S> Eq for HashSetRef<'_, T, S> where
T: Hash + Ord,
S: BuildHasher,
[src]
T: Hash + Ord,
S: BuildHasher,
impl<'g, '_, T, S> IntoIterator for &'g HashSetRef<'_, T, S>
[src]
type IntoIter = Keys<'g, T, ()>
Which kind of iterator are we turning this into?
type Item = &'g T
The type of the elements being iterated over.
fn into_iter(self) -> Self::IntoIter
[src]
impl<'_, T, S> PartialEq<HashSet<T, S>> for HashSetRef<'_, T, S> where
T: Hash + Ord,
S: BuildHasher,
[src]
T: Hash + Ord,
S: BuildHasher,
fn eq(&self, other: &HashSet<T, S>) -> bool
[src]
#[must_use]fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'_, T, S> PartialEq<HashSetRef<'_, T, S>> for HashSetRef<'_, T, S> where
T: Hash + Ord,
S: BuildHasher,
[src]
T: Hash + Ord,
S: BuildHasher,
impl<'_, T, S> PartialEq<HashSetRef<'_, T, S>> for HashSet<T, S> where
T: Hash + Ord,
S: BuildHasher,
[src]
T: Hash + Ord,
S: BuildHasher,
Auto Trait Implementations
impl<'set, T, S = RandomState> !RefUnwindSafe for HashSetRef<'set, T, S>
impl<'set, T, S = RandomState> !Send for HashSetRef<'set, T, S>
impl<'set, T, S = RandomState> !Sync for HashSetRef<'set, T, S>
impl<'set, T, S> Unpin for HashSetRef<'set, T, S>
impl<'set, T, S = RandomState> !UnwindSafe for HashSetRef<'set, T, S>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,