Class MapSerializer<TKey, TValue>
A generic dictionary serializer.
Implements
Inherited Members
Namespace: Gremlin.Net.Structure.IO.GraphBinary.Types
Assembly: Gremlin.Net.dll
Syntax
public class MapSerializer<TKey, TValue> : SimpleTypeSerializer<IDictionary<TKey, TValue?>>, ITypeSerializer where TKey : notnull
Type Parameters
| Name | Description |
|---|---|
| TKey | The type of keys in the dictionary. |
| TValue | The type of values in the dictionary. |
Constructors
MapSerializer()
Initializes a new instance of the MapSerializer<TKey, TValue> class.
Declaration
public MapSerializer()
Methods
ReadValueAsync(Stream, GraphBinaryReader, CancellationToken)
Reads a non-nullable value according to the type format.
Declaration
protected override Task<IDictionary<TKey, TValue?>> ReadValueAsync(Stream stream, GraphBinaryReader reader, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| Stream | stream | The GraphBinary data to parse. |
| GraphBinaryReader | reader | |
| CancellationToken | cancellationToken | The token to cancel the operation. The default value is None. |
Returns
| Type | Description |
|---|---|
| Task<IDictionary<TKey, TValue>> | The read value. |
Overrides
WriteValueAsync(IDictionary<TKey, TValue?>, Stream, GraphBinaryWriter, CancellationToken)
Writes a non-nullable value into a stream.
Declaration
protected override Task WriteValueAsync(IDictionary<TKey, TValue?> value, Stream stream, GraphBinaryWriter writer, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| IDictionary<TKey, TValue> | value | The value to write. |
| Stream | stream | The stream to write to. |
| GraphBinaryWriter | writer | |
| CancellationToken | cancellationToken | The token to cancel the operation. The default value is None. |
Returns
| Type | Description |
|---|---|
| Task | A task that represents the asynchronous write operation. |