Table of Contents

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

asyncEnumerable IAsyncEnumerable<T>

The async enumerable to encode into a stream of bytes.

encodeAction EncodeAction<T>

The action used to encode one element.

useSegments bool

true if an element can be encoded on a variable number of bytes; otherwise, false.

encodeOptions SliceEncodeOptions

The Slice encode options.

Returns

PipeReader

A pipe reader that represents the encoded stream of bytes.

Type Parameters

T

The async enumerable element type.