Struct rustc_data_structures::sso::SsoHashSet [−][src]
pub struct SsoHashSet<T> {
map: SsoHashMap<T, ()>,
}
Expand description
Small-storage-optimized implementation of a set.
Stores elements in a small array up to a certain length
and switches to HashSet
when that length is exceeded.
Fields
map: SsoHashMap<T, ()>
Implementations
Creates an empty SsoHashSet
with the specified capacity.
Returns the number of elements the set can hold without reallocating.
An iterator visiting all elements in arbitrary order.
The iterator element type is &'a T
.
Reserves capacity for at least additional
more elements to be inserted
in the SsoHashSet
. The collection may reserve more space to avoid
frequent reallocations.
Shrinks the capacity of the set as much as possible. It will drop down as much as possible while maintaining the internal rules and possibly leaving some space in accordance with the resize policy.
Retains only the elements specified by the predicate.
Removes and returns the value in the set, if any, that is equal to the given one.
Returns a reference to the value in the set, if any, that is equal to the given value.
Adds a value to the set.
If the set did not have this value present, true
is returned.
If the set did have this value present, false
is returned.
Removes a value from the set. Returns whether the value was present in the set.
Trait Implementations
Extends a collection with the contents of an iterator. Read more
extend_one
)Extends a collection with exactly one element.
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
Extends a collection with the contents of an iterator. Read more
extend_one
)Extends a collection with exactly one element.
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
Creates a value from an iterator. Read more
Which kind of iterator are we turning this into?
Auto Trait Implementations
impl<T> RefUnwindSafe for SsoHashSet<T> where
T: RefUnwindSafe,
impl<T> Send for SsoHashSet<T> where
T: Send,
impl<T> Sync for SsoHashSet<T> where
T: Sync,
impl<T> Unpin for SsoHashSet<T> where
T: Unpin,
impl<T> UnwindSafe for SsoHashSet<T> where
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
Layout
Note: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.