System.Collections.Immutable by Microsoft

<PackageReference Include="System.Collections.Immutable" Version="9.0.12" />

.NET API 259,376 bytes

 FrozenSet<T>

public abstract class FrozenSet<T> : ISet<T>, ICollection<T>, IEnumerable<T>, IEnumerable, IReadOnlyCollection<T>, ICollection
Provides an immutable, read-only set optimized for fast lookup and enumeration.

Enumerates the values of a FrozenSet<T>.

public static FrozenSet<T> Empty { get; }

Gets an empty FrozenSet<T>.

public IEqualityComparer<T> Comparer { get; }

Gets the comparer used by this set.

public int Count { get; }

Gets the number of values contained in the set.

public ImmutableArray<T> Items { get; }

Gets a collection containing the values in the set.

public bool Contains(T item)

Determines whether the set contains the specified element.

public void CopyTo(T[] destination, int destinationIndex)

Copies the values in the set to an array, starting at the specified destinationIndex.

public void CopyTo(Span<T> destination)

Copies the values in the set to a span.

Returns an enumerator that iterates through the set.

public bool IsProperSubsetOf(IEnumerable<T> other)

Determines whether the current set is a proper (strict) subset of a specified collection.

public bool IsProperSupersetOf(IEnumerable<T> other)

Determines whether the current set is a proper (strict) superset of a specified collection.

public bool IsSubsetOf(IEnumerable<T> other)

Determines whether a set is a subset of a specified collection.

public bool IsSupersetOf(IEnumerable<T> other)

Determines whether the current set is a superset of a specified collection.

public bool Overlaps(IEnumerable<T> other)

Determines whether the current set overlaps with the specified collection.

public bool SetEquals(IEnumerable<T> other)

Determines whether the current set and the specified collection contain the same elements.

public bool TryGetValue(T equalValue, out T actualValue)

Searches the set for a given value and returns the equal value it finds, if any.