Struct rustc_ap_rustc_data_structures::sso::SsoHashSet[][src]

pub struct SsoHashSet<T> { /* fields omitted */ }
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.

Implementations

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.

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.

Returns true if the set contains a value.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. 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

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

Creates a value from an iterator. 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

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

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

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.