Interface ITypeSerializer
Provides an interface for serialization and deserialization of K/V pairs.
Namespace: Couchbase.Core.IO.Serializers
Assembly: Couchbase.NetClient.dll
Syntax
public interface ITypeSerializer
Methods
| Edit this page View SourceDeserializeAsync<T>(Stream, CancellationToken)
Deserializes the specified stream into the Type T specified as a generic parameter.
Declaration
ValueTask<T?> DeserializeAsync<T>(Stream stream, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
Stream | stream | The stream. |
CancellationToken | cancellationToken | Cancellation token. |
Returns
Type | Description |
---|---|
ValueTask<T> | The Type instance representing the value of the key. |
Type Parameters
Name | Description |
---|---|
T | The Type specified as the type of the value. |
Deserialize<T>(Stream)
Deserializes the specified stream into the Type T specified as a generic parameter.
Declaration
T? Deserialize<T>(Stream stream)
Parameters
Type | Name | Description |
---|---|---|
Stream | stream | The stream. |
Returns
Type | Description |
---|---|
T | The Type instance representing the value of the key. |
Type Parameters
Name | Description |
---|---|
T | The Type specified as the type of the value. |
Deserialize<T>(ReadOnlyMemory<byte>)
Deserializes the specified buffer into the Type T specified as a generic parameter.
Declaration
T? Deserialize<T>(ReadOnlyMemory<byte> buffer)
Parameters
Type | Name | Description |
---|---|---|
ReadOnlyMemory<byte> | buffer | The buffer to deserialize from. |
Returns
Type | Description |
---|---|
T | The Type instance representing the value of the key. |
Type Parameters
Name | Description |
---|---|
T | The Type specified as the type of the value. |
Serialize(Stream, object?)
Serializes the specified object onto a stream.
Declaration
void Serialize(Stream stream, object? obj)
Parameters
Type | Name | Description |
---|---|---|
Stream | stream | The stream to receive the serialized object. |
object | obj | The object to serialize. |
SerializeAsync(Stream, object?, CancellationToken)
Serializes the specified object onto a stream.
Declaration
ValueTask SerializeAsync(Stream stream, object? obj, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
Stream | stream | The stream to receive the serialized object. |
object | obj | The object to serialize. |
CancellationToken | cancellationToken | Cancellation token. |
Returns
Type | Description |
---|---|
ValueTask |