System.Collections.Immutable by Microsoft

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

.NET API 259,368 bytes

 FrozenDictionary<TKey, TValue>

public abstract class FrozenDictionary<TKey, TValue> : IDictionary<TKey, TValue>, ICollection<KeyValuePair<TKey, TValue>>, IEnumerable<KeyValuePair<TKey, TValue>>, IEnumerable, IReadOnlyDictionary<TKey, TValue>, IReadOnlyCollection<KeyValuePair<TKey, TValue>>, IDictionary, ICollection
Provides an immutable, read-only dictionary optimized for fast lookup and enumeration.
public struct Enumerator<TKey, TValue> : IEnumerator<KeyValuePair<TKey, TValue>>, IDisposable, IEnumerator

Enumerates the elements of a FrozenDictionary<T, U>.

public static FrozenDictionary<TKey, TValue> Empty { get; }

Gets an empty FrozenDictionary<T, U>.

public IEqualityComparer<TKey> Comparer { get; }

Gets the comparer used by this dictionary.

public int Count { get; }

Gets the number of key/value pairs contained in the dictionary.

public TValue& modreq(System.Runtime.InteropServices.InAttribute) this[TKey key] { get; }

Gets a reference to the value associated with the specified key.

public ImmutableArray<TKey> Keys { get; }

Gets a collection containing the keys in the dictionary.

public ImmutableArray<TValue> Values { get; }

Gets a collection containing the values in the dictionary.

public bool ContainsKey(TKey key)

Determines whether the dictionary contains the specified key.

public void CopyTo(KeyValuePair<TKey, TValue>[] destination, int destinationIndex)

Copies the elements of the dictionary to an array of type KeyValuePair<T, U>, starting at the specified destinationIndex.

public void CopyTo(Span<KeyValuePair<TKey, TValue>> destination)

Copies the elements of the dictionary to a span of type KeyValuePair<T, U>.

public Enumerator<TKey, TValue> GetEnumerator()

Returns an enumerator that iterates through the dictionary.

public TValue& modreq(System.Runtime.InteropServices.InAttribute) GetValueRefOrNullRef(TKey key)

Gets either a reference to a TValue in the dictionary or a null reference if the key does not exist in the dictionary.

public bool TryGetValue(TKey key, out TValue value)

Gets the value associated with the specified key.