[][src]Struct flurry::HashSetRef

pub struct HashSetRef<'set, T, S = DefaultHashBuilder> { /* fields omitted */ }

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]

pub fn contains<Q: ?Sized>(&self, value: &Q) -> bool where
    T: Borrow<Q>,
    Q: Hash + Ord
[src]

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]

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]

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]

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]

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]

Retains only the elements specified by the predicate.

See also HashSet::retain.

impl<'_, T, S> HashSetRef<'_, T, S> where
    T: Clone + Ord
[src]

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]

impl<'_, T, S> Debug for HashSetRef<'_, T, S> where
    T: Debug
[src]

impl<'_, T, S> Eq for HashSetRef<'_, T, S> where
    T: Hash + Ord,
    S: BuildHasher
[src]

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.

impl<'_, T, S> PartialEq<HashSet<T, S>> for HashSetRef<'_, T, S> where
    T: Hash + Ord,
    S: BuildHasher
[src]

impl<'_, T, S> PartialEq<HashSetRef<'_, T, S>> for HashSetRef<'_, T, S> where
    T: Hash + Ord,
    S: BuildHasher
[src]

impl<'_, T, S> PartialEq<HashSetRef<'_, T, S>> for HashSet<T, S> where
    T: Hash + Ord,
    S: BuildHasher
[src]

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.