IYielder.cs 926 B

1234567891011121314151617181920212223242526
  1. // Licensed to the .NET Foundation under one or more agreements.
  2. // The .NET Foundation licenses this file to you under the MIT License.
  3. // See the LICENSE file in the project root for more information.
  4. namespace System.Linq
  5. {
  6. /// <summary>
  7. /// Interface for yielding elements to enumerator.
  8. /// </summary>
  9. /// <typeparam name="T">Type of the elements yielded to an enumerator.</typeparam>
  10. public interface IYielder<in T>
  11. {
  12. /// <summary>
  13. /// Stops the enumeration.
  14. /// </summary>
  15. /// <returns>Awaitable object for use in an asynchronous method.</returns>
  16. IAwaitable Break();
  17. /// <summary>
  18. /// Yields a value to the enumerator.
  19. /// </summary>
  20. /// <param name="value">Value to yield return.</param>
  21. /// <returns>Awaitable object for use in an asynchronous method.</returns>
  22. IAwaitable Return(T value);
  23. }
  24. }