System.Collections.Immutable 11.0.0-preview.7.26381.103
About
This package provides collections that are thread safe and guaranteed to never change their contents, also known as immutable collections. Like strings, any methods that perform modifications will not change the existing instance but instead return a new instance. For efficiency reasons, the implementation uses a sharing mechanism to ensure that newly created instances share as much data as possible with the previous instance while ensuring that operations have a predictable time complexity.
The System.Collections.Immutable library is built-in as part of the shared framework in .NET Runtime. The package can be installed when you need to use it in other target frameworks.
How to Use
using System.Collections.Immutable;
// Create immutable set of strings
ImmutableHashSet<string> colors = ImmutableHashSet.Create("Red", "Green", "Blue");
// Create a new set by adding and removing items from the original set
ImmutableHashSet<string> colorsModified = colors.Remove("Red").Add("Orange");
foreach (string s in colorsModified)
{
Console.WriteLine(s);
}
/* Example output:
Blue
Green
Orange
*/
Main Types
The main types provided by this library are:
System.Collections.Immutable.ImmutableArraySystem.Collections.Immutable.ImmutableArray<T>System.Collections.Immutable.ImmutableDictionarySystem.Collections.Immutable.ImmutableDictionary<TKey,TValue>System.Collections.Immutable.ImmutableHashSetSystem.Collections.Immutable.ImmutableHashSet<T>System.Collections.Immutable.ImmutableListSystem.Collections.Immutable.ImmutableList<T>System.Collections.Immutable.ImmutableQueueSystem.Collections.Immutable.ImmutableQueue<T>System.Collections.Immutable.ImmutableSortedDictionarySystem.Collections.Immutable.ImmutableSortedDictionary<TKey,TValue>System.Collections.Immutable.ImmutableSortedSetSystem.Collections.Immutable.ImmutableSortedSet<T>System.Collections.Immutable.ImmutableStackSystem.Collections.Immutable.ImmutableStack<T>System.Collections.Frozen.FrozenDictionarySystem.Collections.Frozen.FrozenDictionary<TKey, TValue>System.Collections.Frozen.FrozenSetSystem.Collections.Frozen.FrozenSet<T>
Additional Documentation
Feedback & Contributing
System.Collections.Immutable is released as open source under the MIT license. Bug reports and contributions are welcome at the GitHub repository.
Showing the top 20 packages that depend on System.Collections.Immutable.
| Packages | Downloads |
|---|---|
|
protobuf-net.Core
Provides simple access to fast and efficient "Protocol Buffers" serialization from .NET applications
|
237 |
|
Nito.Disposables
IDisposable and IAsyncDisposable helper types.
|
236 |
|
MessagePack
Extremely Fast MessagePack(MsgPack) Serializer for C# (.NET Framework, .NET 6, Unity, Xamarin).
|
235 |
|
Humanizer.Core
Humanizer core package that contains the library and the neutral language (English) resources
|
232 |
|
Humanizer.Core
Humanizer core package that contains the library and the neutral language (English) resources
|
180 |
|
Anthropic
The official .NET library for the Anthropic API.
|
140 |
|
Anthropic
The official .NET library for the Anthropic API.
|
110 |
|
protobuf-net.Core
Provides simple access to fast and efficient "Protocol Buffers" serialization from .NET applications
|
56 |
|
System.Reflection.MetadataLoadContext
Provides read-only reflection on assemblies in an isolated context with support for assemblies that target different processor architectures and runtimes. Using MetadataLoadContext enables you to inspect assemblies without loading them into the main execution context. Assemblies in MetadataLoadContext are treated only as metadata, that is, you can read information about their members, but cannot execute any code contained in them.
|
54 |
|
MessagePack
Extremely Fast MessagePack(MsgPack) Serializer for C# (.NET Framework, .NET 6, Unity, Xamarin).
|
45 |
|
Nerdbank.MessagePack
A fast and more user-friendly MessagePack serialization library for .NET and .NET Framework. This package is brought to you by one of the two major contributors to MessagePack-CSharp. As its natural successor, this library comes packed with features that its predecessor lacks, and has ongoing support.
Premium support for trimming and Native AOT, secure deserialization of untrusted data, async serialization, streaming deserialization, skip serializing of default values, reference preservation, and support for reference cycles.
Also features an automatic structural equality API.
|
41 |
|
StreamJsonRpc
A cross-platform .NETStandard library that implements the JSON-RPC wire protocol and can use System.IO.Stream, System.IO.Pipelines or WebSocket so you can use it with any transport.
|
33 |
|
Allure.Net.Commons
Provides common facilities to build Allure adapters for .NET test frameworks.
|
20 |
|
System.Reflection.MetadataLoadContext
Provides read-only reflection on assemblies in an isolated context with support for assemblies that target different processor architectures and runtimes. Using MetadataLoadContext enables you to inspect assemblies without loading them into the main execution context. Assemblies in MetadataLoadContext are treated only as metadata, that is, you can read information about their members, but cannot execute any code contained in them.
|
15 |
|
Anthropic
The official .NET library for the Anthropic API.
|
15 |
|
System.Reflection.MetadataLoadContext
Provides read-only reflection on assemblies in an isolated context with support for assemblies that target different processor architectures and runtimes. Using MetadataLoadContext enables you to inspect assemblies without loading them into the main execution context. Assemblies in MetadataLoadContext are treated only as metadata, that is, you can read information about their members, but cannot execute any code contained in them.
|
14 |
|
Allure.Net.Commons
Provides common facilities to build Allure adapters for .NET test frameworks.
|
13 |
|
Yarp.ReverseProxy
Reverse proxy toolkit for building fast proxy servers in .NET using the infrastructure from ASP.NET and .NET
|
11 |
|
Anthropic
The official .NET library for the Anthropic API.
|
10 |
.NET 10.0
- No dependencies.
.NET 11.0
- No dependencies.
.NET Framework 4.6.2
- System.Memory (>= 4.6.3)
- System.Runtime.CompilerServices.Unsafe (>= 6.1.2)
.NET Standard 2.0
- System.Memory (>= 4.6.3)
- System.Runtime.CompilerServices.Unsafe (>= 6.1.2)