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.

Source§

Source

Creates an empty SsoHashSet.

Source

Creates an empty SsoHashSet with the specified capacity.

Source

Clears the set, removing all values.

Source

Returns the number of elements the set can hold without reallocating.

Source

Returns the number of elements in the set.

Source

Returns true if the set contains no elements.

Source

An iterator visiting all elements in arbitrary order. The iterator element type is &'a T.

Source

Clears the set, returning all elements in an iterator.

Source§

Source

Reserves capacity for at least additional more elements to be inserted in the SsoHashSet. The collection may reserve more space to avoid frequent reallocations.

Source

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.

Source

Retains only the elements specified by the predicate.

Source

Removes and returns the value in the set, if any, that is equal to the given one.

Source

Returns a reference to the value in the set, if any, that is equal to the given value.

Source

Adds a value to the set.

Returns whether the value was newly inserted. That is:

Source

Removes a value from the set. Returns whether the value was present in the set.

Source

Returns true if the set contains a value.

Source§

Source§

Source§

Source§

Source§

Extends a collection with the contents of an iterator. Read more

Source§

🔬This is a nightly-only experimental API. (extend_one)

Extends a collection with exactly one element.

Source§

🔬This is a nightly-only experimental API. (extend_one)

Reserves capacity in a collection for the given number of additional elements. Read more

Source§

Source§

Extends a collection with the contents of an iterator. Read more

Source§

🔬This is a nightly-only experimental API. (extend_one)

Extends a collection with exactly one element.

Source§

🔬This is a nightly-only experimental API. (extend_one)

Reserves capacity in a collection for the given number of additional elements. Read more

Source§

Source§

Source§

Which kind of iterator are we turning this into?

Source§

The type of the elements being iterated over.

Source§

Creates an iterator from a value. Read more

Source§

Source§

Which kind of iterator are we turning this into?

Source§

The type of the elements being iterated over.

Source§

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.