Struct SwiftDictionaryState<TKey, TValue>
- Namespace
- SwiftCollections
- Assembly
- SwiftCollections.dll
Represents an immutable snapshot of the key-value pairs contained in a dictionary at a specific point in time.
[MemoryPackable(GenerateType.Object)]
public readonly struct SwiftDictionaryState<TKey, TValue> : IMemoryPackable<SwiftDictionaryState<TKey, TValue>>, IMemoryPackFormatterRegister
Type Parameters
TKeyThe type of keys in the dictionary.
TValueThe type of values in the dictionary.
- Implements
-
IMemoryPackable<SwiftDictionaryState<TKey, TValue>>IMemoryPackFormatterRegister
- Inherited Members
Remarks
This struct is typically used to serialize or transfer the state of a dictionary. The contents are read-only and reflect the state of the dictionary when the snapshot was taken.
Constructors
SwiftDictionaryState(KeyValuePair<TKey, TValue>[])
Initializes a new instance of the SwiftDictionaryState class with the specified key-value pairs.
[JsonConstructor]
[MemoryPackConstructor]
public SwiftDictionaryState(KeyValuePair<TKey, TValue>[] items)
Parameters
itemsKeyValuePair<TKey, TValue>[]An array of key-value pairs to initialize the dictionary state. Cannot be null.
Remarks
This constructor is typically used during deserialization to restore the state of the dictionary from a serialized array of key-value pairs.
Fields
Items
Gets the collection of key/value pairs contained in the object.
[JsonInclude]
[MemoryPackInclude]
public readonly KeyValuePair<TKey, TValue>[] Items
Field Value
- KeyValuePair<TKey, TValue>[]