System.Collections.Immutable Namespace (original) (raw)

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Contains interfaces and classes that define immutable collections.

Classes

Name Description
ImmutableArray Provides methods for creating an array that is immutable, meaning it can't be changed once it's created.
ImmutableArray.Builder Represents a writable array accessor that can be converted into an ImmutableArray instance without allocating extra memory.
ImmutableDictionary Provides a set of initialization methods for instances of the ImmutableDictionary<TKey,TValue> class.
ImmutableDictionary<TKey,TValue>.Builder Represents a hash map that mutates with little or no memory allocations and that can produce or build on immutable hash map instances efficiently.
ImmutableDictionary<TKey,TValue> Represents an immutable, unordered collection of keys and values.
ImmutableHashSet Provides a set of initialization methods for instances of the ImmutableHashSet class.
ImmutableHashSet.Builder Represents a hash set that mutates with little or no memory allocations and that can produce or build on immutable hash set instances efficiently.
ImmutableHashSet Represents an immutable, unordered hash set.
ImmutableInterlocked Contains interlocked exchange mechanisms for immutable collections.
ImmutableList Provides a set of initialization methods for instances of the ImmutableList class.
ImmutableList.Builder Represents a list that mutates with little or no memory allocations and that can produce or build on immutable list instances efficiently.
ImmutableList Represents an immutable list, which is a strongly typed list of objects that can be accessed by index.
ImmutableQueue Provides a set of initialization methods for instances of the ImmutableQueue class.
ImmutableQueue Represents an immutable queue.
ImmutableSortedDictionary Provides a set of initialization methods for instances of the ImmutableSortedDictionary<TKey,TValue> class.
ImmutableSortedDictionary<TKey,TValue>.Builder Represents a sorted dictionary that mutates with little or no memory allocations and that can produce or build on immutable sorted dictionary instances efficiently.
ImmutableSortedDictionary<TKey,TValue> Represents an immutable sorted dictionary.
ImmutableSortedSet Provides a set of initialization methods for instances of the ImmutableSortedSet class.
ImmutableSortedSet.Builder Represents a sorted set that enables changes with little or no memory allocations, and efficiently manipulates or builds immutable sorted sets.
ImmutableSortedSet Represents an immutable sorted set implementation.
ImmutableStack Provides a set of initialization methods for instances of the ImmutableStack class.
ImmutableStack Represents an immutable stack.

Structs

Name Description
ImmutableArray.Enumerator Represents an array enumerator.
ImmutableArray Represents an array that is immutable, meaning it can't be changed once it's created.
ImmutableDictionary<TKey,TValue>.Enumerator Enumerates the contents of the immutable dictionary without allocating any memory.
ImmutableHashSet.Enumerator Enumerates the contents of the immutable hash set without allocating any memory.
ImmutableList.Enumerator Enumerates the contents of a binary tree.
ImmutableQueue.Enumerator Enumerates the contents of an immutable queue without allocating any memory.
ImmutableSortedDictionary<TKey,TValue>.Enumerator Enumerates the contents of a binary tree.
ImmutableSortedSet.Enumerator Enumerates the contents of a binary tree.
ImmutableStack.Enumerator Enumerates the contents of an immutable stack without allocating any memory.

Interfaces

Name Description
IImmutableDictionary<TKey,TValue> Represents an immutable collection of key/value pairs.
IImmutableList Represents a list of elements that cannot be modified.
IImmutableQueue Represents an immutable first-in, first-out collection of objects.
IImmutableSet Represents a set of elements that can only be modified by creating a new instance of the set.
IImmutableStack Represents an immutable last-in-first-out (LIFO) collection.

Remarks

With immutable collections, you can: