// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. using System; using System.Threading.Tasks; using System.Threading; namespace System.Collections.Generic { /// /// Asynchronous version of the IEnumerator<T> interface, allowing elements to be /// retrieved asynchronously. /// /// Element type. public interface IAsyncEnumerator< #if !NO_VARIANCE out #endif T> : IDisposable { /// /// Advances the enumerator to the next element in the sequence, returning the result asynchronously. /// /// Cancellation token that can be used to cancel the operation. /// /// Task containing the result of the operation: true if the enumerator was successfully advanced /// to the next element; false if the enumerator has passed the end of the sequence. /// Task MoveNext(CancellationToken cancellationToken); /// /// Gets the current element in the iteration. /// T Current { get; } } }