Show / Hide Table of Contents

Interface ISerializable<TSelf>

Represents an object that supports serialization and deserialization.

Inherited Members
IDataTransferObject.WriteToAsync<TWriter>(TWriter, CancellationToken)
IDataTransferObject.TransformAsync<TResult, TTransformation>(Stream, TTransformation, bool, Memory<byte>, CancellationToken)
IDataTransferObject.TransformAsync<TResult, TTransformation>(Stream, TTransformation, bool, MemoryAllocator<byte>, CancellationToken)
IDataTransferObject.TransformAsync<TResult, TTransformation>(Stream, TTransformation, bool, CancellationToken)
IDataTransferObject.TransformAsync<TResult, TTransformation>(PipeReader, TTransformation, CancellationToken)
IDataTransferObject.TransformAsync<TResult, TTransformation>(TTransformation, CancellationToken)
IDataTransferObject.TryGetMemory(out ReadOnlyMemory<byte>)
IDataTransferObject.Empty
IDataTransferObject.IsReusable
IDataTransferObject.Length
Namespace: DotNext.Runtime.Serialization
Assembly: DotNext.IO.dll
Syntax
public interface ISerializable<TSelf> : IDataTransferObject where TSelf : ISerializable<TSelf>
Type Parameters
Name Description
TSelf

The implementing type.

Methods

View Source

ReadFromAsync<TReader>(TReader, CancellationToken)

Decodes the object of type TSelf from its binary representation.

Declaration
public static abstract ValueTask<TSelf> ReadFromAsync<TReader>(TReader reader, CancellationToken token) where TReader : IAsyncBinaryReader
Parameters
Type Name Description
TReader reader

The reader.

CancellationToken token

The token that can be used to cancel the operation.

Returns
Type Description
ValueTask<TSelf>

The decoded object.

Type Parameters
Name Description
TReader

The type of the reader.

Exceptions
Type Condition
OperationCanceledException

The operation has been canceled.

View Source

TransformAsync<TInput>(TInput, CancellationToken)

Transforms one object into another object.

Declaration
public static ValueTask<TSelf> TransformAsync<TInput>(TInput input, CancellationToken token = default) where TInput : IDataTransferObject
Parameters
Type Name Description
TInput input

The object to transform.

CancellationToken token

The token that can be used to cancel the operation.

Returns
Type Description
ValueTask<TSelf>

Deserialized object.

Type Parameters
Name Description
TInput

The type of the object to transform.

Exceptions
Type Condition
OperationCanceledException

The operation has been canceled.

  • View Source
☀
☾
In this article
Back to top
Supported by the .NET Foundation
☀
☾