Represents the structured data unit that can be transferred over wire.
Namespace: DotNext.IO Assembly: DotNext.IO.dll Syntaxpublic interface IDataTransferObject
Properties | Edit this page View Source Empty
Gets empty data transfer object.
Declarationpublic static IDataTransferObject Empty { get; }
Property Value | Edit this page View Source IsReusable
Indicates that the content of this object can be copied to the output stream or pipe multiple times.
Declaration Property Value | Edit this page View Source LengthGets length of the object payload, in bytes.
Declaration Property Value Methods | Edit this page View Source TransformAsync<TResult, TTransformation>(PipeReader, TTransformation, CancellationToken)Decodes the data using pipe reader.
Declarationprotected static ValueTask<TResult> TransformAsync<TResult, TTransformation>(PipeReader input, TTransformation transformation, CancellationToken token) where TTransformation : IDataTransferObject.ITransformation<TResult>
Parameters Type Name Description PipeReader input
The pipe reader used for decoding.
TTransformation transformationThe decoder.
CancellationToken tokenThe token that can be used to cancel the operation.
Returns Type Description ValueTask<TResult>The decoded stream.
Type Parameters Name Description TResultThe type of result.
TTransformationThe type of parser.
Exceptions | Edit this page View Source TransformAsync<TResult, TTransformation>(Stream, TTransformation, bool, MemoryAllocator<byte>?, CancellationToken)Decodes the stream.
Declarationprotected static ValueTask<TResult> TransformAsync<TResult, TTransformation>(Stream input, TTransformation transformation, bool resetStream, MemoryAllocator<byte>? allocator, CancellationToken token) where TTransformation : IDataTransferObject.ITransformation<TResult>
Parameters Type Name Description Stream input
The stream to decode.
TTransformation transformationThe decoder.
bool resetStreamtrue to reset stream position after decoding.
MemoryAllocator<byte> allocatorThe allocator of temporary buffer.
CancellationToken tokenThe token that can be used to cancel the operation.
Returns Type Description ValueTask<TResult>The decoded stream.
Type Parameters Name Description TResultThe type of result.
TTransformationThe type of parser.
Exceptions | Edit this page View Source TransformAsync<TResult, TTransformation>(Stream, TTransformation, bool, Memory<byte>, CancellationToken)Decodes the stream.
Declarationprotected static ValueTask<TResult> TransformAsync<TResult, TTransformation>(Stream input, TTransformation transformation, bool resetStream, Memory<byte> buffer, CancellationToken token) where TTransformation : IDataTransferObject.ITransformation<TResult>
Parameters Type Name Description Stream input
The stream to decode.
TTransformation transformationThe decoder.
bool resetStreamtrue to reset stream position after decoding.
Memory<byte> bufferThe temporary buffer.
CancellationToken tokenThe token that can be used to cancel the operation.
Returns Type Description ValueTask<TResult>The decoded stream.
Type Parameters Name Description TResultThe type of result.
TTransformationThe type of parser.
Exceptions | Edit this page View Source TransformAsync<TResult, TTransformation>(Stream, TTransformation, bool, CancellationToken)Decodes the stream.
Declarationprotected static ValueTask<TResult> TransformAsync<TResult, TTransformation>(Stream input, TTransformation transformation, bool resetStream, CancellationToken token) where TTransformation : IDataTransferObject.ITransformation<TResult>
Parameters Type Name Description Stream input
The stream to decode.
TTransformation transformationThe decoder.
bool resetStreamtrue to reset stream position after decoding.
CancellationToken tokenThe token that can be used to cancel the operation.
Returns Type Description ValueTask<TResult>The decoded stream.
Type Parameters Name Description TResultThe type of result.
TTransformationThe type of parser.
Exceptions | Edit this page View Source TransformAsync<TResult, TTransformation>(TTransformation, CancellationToken)Converts the data transfer object to another type.
DeclarationValueTask<TResult> TransformAsync<TResult, TTransformation>(TTransformation transformation, CancellationToken token = default) where TTransformation : IDataTransferObject.ITransformation<TResult>
Parameters Type Name Description TTransformation transformation
The parser instance.
CancellationToken tokenThe token that can be used to cancel the operation.
Returns Type Description ValueTask<TResult>The converted DTO content.
Type Parameters Name Description TResultThe type of result.
TTransformationThe type of parser.
Exceptions | Edit this page View Source TryGetMemory(out ReadOnlyMemory<byte>)Attempts to retrieve the contents of this object as a memory block synchronously.
Declarationbool TryGetMemory(out ReadOnlyMemory<byte> memory)
Parameters Type Name Description ReadOnlyMemory<byte> memory
The memory block containing the contents of this object.
Returns Type Description booltrue if this object is representable as a memory block; otherwise, false.
| Edit this page View Source WriteToAsync<TWriter>(TWriter, CancellationToken)Transforms this object to serialized form.
DeclarationValueTask WriteToAsync<TWriter>(TWriter writer, CancellationToken token) where TWriter : IAsyncBinaryWriter
Parameters Type Name Description TWriter writer
The binary writer.
CancellationToken tokenThe toke that can be used to cancel the operation.
Returns Type Description ValueTaskThe task representing state of asynchronous execution.
Type Parameters Name Description TWriterThe type of writer.
Exceptions Extension Methods See AlsoRetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4