AsyncEnumerableHelpers
using System.Linq;
using System.Runtime.CompilerServices;
using System.Threading;
using System.Threading.Tasks;
namespace System.Collections.Generic
{
[System.Runtime.CompilerServices.NullableContext(1)]
[System.Runtime.CompilerServices.Nullable(0)]
internal static class AsyncEnumerableHelpers
{
[System.Runtime.CompilerServices.NullableContext(0)]
internal struct ArrayWithLength<[System.Runtime.CompilerServices.Nullable(2)] T>
{
[System.Runtime.CompilerServices.Nullable(1)]
public T[] Array;
public int Length;
}
[AsyncStateMachine(typeof(<ToArray>d__0<>))]
[return: System.Runtime.CompilerServices.Nullable(new byte[] {
0,
1,
1
})]
internal static ValueTask<T[]> ToArray<[System.Runtime.CompilerServices.Nullable(2)] T>(IAsyncEnumerable<T> source, CancellationToken cancellationToken)
{
<ToArray>d__0<T> stateMachine = default(<ToArray>d__0<T>);
stateMachine.<>t__builder = AsyncValueTaskMethodBuilder<T[]>.Create();
stateMachine.source = source;
stateMachine.cancellationToken = cancellationToken;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
[AsyncStateMachine(typeof(<ToArrayWithLength>d__1<>))]
[return: System.Runtime.CompilerServices.Nullable(new byte[] {
0,
0,
1
})]
internal static ValueTask<ArrayWithLength<T>> ToArrayWithLength<[System.Runtime.CompilerServices.Nullable(2)] T>(IAsyncEnumerable<T> source, CancellationToken cancellationToken)
{
<ToArrayWithLength>d__1<T> stateMachine = default(<ToArrayWithLength>d__1<T>);
stateMachine.<>t__builder = AsyncValueTaskMethodBuilder<ArrayWithLength<T>>.Create();
stateMachine.source = source;
stateMachine.cancellationToken = cancellationToken;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
[AsyncStateMachine(typeof(<ToSet>d__2<>))]
internal static Task<System.Linq.Set<T>> ToSet<[System.Runtime.CompilerServices.Nullable(2)] T>(IAsyncEnumerable<T> source, [System.Runtime.CompilerServices.Nullable(new byte[] {
2,
1
})] IEqualityComparer<T> comparer, CancellationToken cancellationToken)
{
<ToSet>d__2<T> stateMachine = default(<ToSet>d__2<T>);
stateMachine.<>t__builder = AsyncTaskMethodBuilder<System.Linq.Set<T>>.Create();
stateMachine.source = source;
stateMachine.comparer = comparer;
stateMachine.cancellationToken = cancellationToken;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
}
}