Interface IAsyncWriter<TRow>
Interface for writing rows asynchronously.
Namespace: Cesil
Assembly: Cesil.dll
Syntax
public interface IAsyncWriter<TRow> : IAsyncDisposable
Type Parameters
Name | Description |
---|---|
TRow |
Methods
WriteAllAsync(IAsyncEnumerable<TRow>, CancellationToken)
Writes all rows enumerated by the given IAsyncEnumerable.
Will complete synchronously if possible, but will not block if all rows are not immediately available or if the underlying sink does not complete immediately.
Returns the number of rows written.
Declaration
ValueTask<int> WriteAllAsync(IAsyncEnumerable<TRow> rows, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IAsyncEnumerable<TRow> | rows | |
System.Threading.CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
System.Threading.Tasks.ValueTask<System.Int32> |
WriteAllAsync(IEnumerable<TRow>, CancellationToken)
Writes all rows enumerated by the given IEnumerable.
Will complete synchronously if possible, but will not block if the underlying sink does not complete immediately.
Returns the number of rows written.
Declaration
ValueTask<int> WriteAllAsync(IEnumerable<TRow> rows, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<TRow> | rows | |
System.Threading.CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
System.Threading.Tasks.ValueTask<System.Int32> |
WriteAsync(TRow, CancellationToken)
Write a single row.
Will complete synchronously if possible, but will not block if the underlying sink does not complete immediately.
Declaration
ValueTask WriteAsync(TRow row, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
TRow | row | |
System.Threading.CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
System.Threading.Tasks.ValueTask |
WriteCommentAsync(ReadOnlyMemory<Char>, CancellationToken)
Write a comment as a row.
Only supported if this IWriter's configuration has a way to indicate comments.
If the comment contains the row ending character sequence, it will be written as multiple comment lines.
Will complete synchronously if possible, but will not block if the underlying sink does not complete immediately.
Declaration
ValueTask WriteCommentAsync(ReadOnlyMemory<char> comment, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
System.ReadOnlyMemory<System.Char> | comment | |
System.Threading.CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
System.Threading.Tasks.ValueTask |
WriteCommentAsync(String, CancellationToken)
Write a comment as a row.
Only supported if this IWriter's configuration has a way to indicate comments.
If the comment contains the row ending character sequence, it will be written as multiple comment lines.
Will complete synchronously if possible, but will not block if the underlying sink does not complete immediately.
Declaration
ValueTask WriteCommentAsync(string comment, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | comment | |
System.Threading.CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
System.Threading.Tasks.ValueTask |