Class AsyncEnumerableExtensions
- Namespace
- IceRpc.Slice.Operations
- Assembly
- IceRpc.Slice.dll
Provides an extension method for IAsyncEnumerable<T> to encode elements into a PipeReader.
public static class AsyncEnumerableExtensions
- Inheritance
-
AsyncEnumerableExtensions
- Inherited Members
Methods
ToPipeReader<T>(IAsyncEnumerable<T>, EncodeAction<T>, bool, SliceEncodeOptions?)
Encodes an async enumerable into a stream of bytes represented by a PipeReader.
public static PipeReader ToPipeReader<T>(this IAsyncEnumerable<T> asyncEnumerable, EncodeAction<T> encodeAction, bool useSegments, SliceEncodeOptions? encodeOptions = null)
Parameters
asyncEnumerableIAsyncEnumerable<T>The async enumerable to encode into a stream of bytes.
encodeActionEncodeAction<T>The action used to encode one element.
useSegmentsbooltrue if an element can be encoded on a variable number of bytes; otherwise, false.
encodeOptionsSliceEncodeOptionsThe Slice encode options.
Returns
- PipeReader
A pipe reader that represents the encoded stream of bytes.
Type Parameters
TThe async enumerable element type.