Class GraphSONMessageSerializer
Serializes data to and from Gremlin Server in GraphSON format.
Implements
Inherited Members
Namespace: Gremlin.Net.Structure.IO.GraphSON
Assembly: Gremlin.Net.dll
Syntax
public abstract class GraphSONMessageSerializer : IMessageSerializer
Constructors
GraphSONMessageSerializer(string, GraphSONReader, GraphSONWriter)
Initializes a new instance of the GraphSONMessageSerializer class.
Declaration
protected GraphSONMessageSerializer(string mimeType, GraphSONReader graphSONReader, GraphSONWriter graphSonWriter)
Parameters
Type | Name | Description |
---|---|---|
string | mimeType | The MIME type supported by this serializer. |
GraphSONReader | graphSONReader | The GraphSONReader used to deserialize from GraphSON. |
GraphSONWriter | graphSonWriter | The GraphSONWriter used to serialize to GraphSON. |
Methods
DeserializeMessageAsync(byte[], CancellationToken)
Deserializes a ResponseMessage<T> from a byte array.
Declaration
public virtual Task<ResponseMessage<List<object>>?> DeserializeMessageAsync(byte[] message, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
byte[] | message | The serialized message to deserialize. |
CancellationToken | cancellationToken | The token to cancel the operation. The default value is None. |
Returns
Type | Description |
---|---|
Task<ResponseMessage<List<object>>> | The deserialized ResponseMessage<T>. |
SerializeMessageAsync(RequestMessage, CancellationToken)
Serializes a RequestMessage.
Declaration
public virtual Task<byte[]> SerializeMessageAsync(RequestMessage requestMessage, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
RequestMessage | requestMessage | The RequestMessage to serialize. |
CancellationToken | cancellationToken | The token to cancel the operation. The default value is None. |
Returns
Type | Description |
---|---|
Task<byte[]> | The serialized message. |