SsoHashSet in rustc_data_structures::sso - Rust (original) (raw)
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.
Creates an empty SsoHashSet.
Creates an empty SsoHashSet with the specified capacity.
Clears the set, removing all values.
Returns the number of elements the set can hold without reallocating.
Returns the number of elements in the set.
Returns true if the set contains no elements.
An iterator visiting all elements in arbitrary order. The iterator element type is &'a T.
Clears the set, returning all elements in an iterator.
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.
Returns whether the value was newly inserted. That is:
- If the set did not previously contain this value,
trueis returned. - If the set already contained this value,
falseis returned.
Removes a value from the set. Returns whether the value was present in the set.
Returns true if the set contains a value.
Extends a collection with the contents of an iterator. Read more
🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
🔬This is a nightly-only experimental API. (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
🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
Which kind of iterator are we turning this into?
The type of the elements being iterated over.
Creates an iterator from a value. Read more
Which kind of iterator are we turning this into?
The type of the elements being iterated over.
Creates an iterator from a value. Read more
Note: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.