<PackageReference Include="System.Collections.Immutable" Version="11.0.0-preview.4.26230.115" />

System.Collections.Frozen.FrozenSet<T>

Provides an immutable, read-only set optimized for fast lookup and enumeration.
namespace System.Collections.Frozen { public abstract class FrozenSet<[Nullable(2)] T> : ISet<T>, ICollection<T>, IEnumerable<T>, IEnumerable, IReadOnlySet<T>, IReadOnlyCollection<T>, ICollection { internal delegate int AlternateLookupDelegate<TAlternate> (FrozenSet<T> set, TAlternate key); public struct Enumerator : IEnumerator<T>, IEnumerator, IDisposable { public T Current { get; } public bool MoveNext(); } public readonly struct AlternateLookup<[Nullable(2)] TAlternate> { public FrozenSet<T> Set { get; } public bool Contains(TAlternate item); public bool TryGetValue(TAlternate equalValue, out T actualValue); } public static FrozenSet<T> Empty { get; } public IEqualityComparer<T> Comparer { get; } public ImmutableArray<T> Items { get; } public int Count { get; } public void CopyTo(T[] destination, int destinationIndex); public void CopyTo(Span<T> destination); public bool Contains(T item); public bool TryGetValue(T equalValue, out T actualValue); public Enumerator GetEnumerator(); public bool IsProperSubsetOf(IEnumerable<T> other); public bool IsProperSupersetOf(IEnumerable<T> other); public bool IsSubsetOf(IEnumerable<T> other); public bool IsSupersetOf(IEnumerable<T> other); public bool Overlaps(IEnumerable<T> other); public bool SetEquals(IEnumerable<T> other); public AlternateLookup<TAlternate> GetAlternateLookup<TAlternate>(); public bool TryGetAlternateLookup<TAlternate>(out AlternateLookup<TAlternate> lookup); } }