AsyncEnumerator
Provides a set of extension methods for IAsyncEnumerator<T>.
public static IAsyncEnumerator<T> Create<T>(Func<ValueTask<bool>> moveNextAsync, Func<T> getCurrent, Func<ValueTask> disposeAsync)
Creates a new enumerator using the specified delegates implementing the members of IAsyncEnumerator<T>.
public static ValueTask<bool> MoveNextAsync<T>(this IAsyncEnumerator<T> source, CancellationToken cancellationToken)
Advances the enumerator to the next element in the sequence, returning the result asynchronously.
public static IAsyncEnumerator<T> WithCancellation<T>(this IAsyncEnumerator<T> source, CancellationToken cancellationToken)
Wraps the specified enumerator with an enumerator that checks for cancellation upon every invocation
of the MoveNextAsync method.