System.Collections.Async.AsyncEnumerableWithState<TItem, TState>
public class AsyncEnumerableWithState<TItem, TState> : AsyncEnumerable, IAsyncEnumerable<TItem>, IAsyncEnumerable
namespace System.Collections.Async
{
public interface IAsyncEnumerable
{
Task<IAsyncEnumerator> GetAsyncEnumeratorAsync(CancellationToken cancellationToken = default(CancellationToken));
}
}
namespace System.Collections.Async
{
public class AsyncEnumerableWithState<TItem, TState> : AsyncEnumerable, IAsyncEnumerable<TItem>, IAsyncEnumerable
{
protected TState State { get; }
public AsyncEnumerableWithState(Func<AsyncEnumerator<TItem>.Yield, TState, Task> enumerationFunction, TState state);
public virtual Task<IAsyncEnumerator<TItem>> GetAsyncEnumeratorAsync(CancellationToken cancellationToken = default(CancellationToken));
}
}