Collection
Provides utility methods to work with collections.
Represents a wrapped for method TryTake
in the form of enumerable collection.
Adds multiple items into collection.
Adds items to the end of collection.
public static ReadOnlyCollectionView<TInput, TOutput> Convert<TInput, TOutput>(this IReadOnlyCollection<TInput> collection, Converter<TInput, TOutput> converter)
Returns lazily converted read-only collection.
public static MemoryOwner<T> Copy<T>(this IEnumerable<T> enumerable, int sizeHint = 0, MemoryAllocator<T> allocator = null)
Creates a copy of the elements from the collection.
Obtains element at the specified index in the sequence.
Obtains the first element of a sequence; or None
if the sequence is empty.
Applies specified action to each collection element.
public static ValueTask ForEachAsync<T>(this IEnumerable<T> collection, Func<T, CancellationToken, ValueTask> action, CancellationToken token = default)
Applies the specified asynchronous action to each collection element.
Gets consumer of thread-safe concurrent collection.
Obtains the last element of a sequence; or None
if the sequence is empty.
Adds items to the beginning of collection.
Computes hash code for the sequence of objects.
Skip null values in the collection.
Converts collection into single-dimensional array.
Converts read-only collection into single-dimensional array.
Converts synchronous collection of elements to asynchronous.
public static IAsyncEnumerator<T> ToAsyncEnumerator<TEnumerator, T>(this TEnumerator enumerator, CancellationToken token) where TEnumerator : struct, IEnumerator<TEnumerator, T>
Converts ad-hoc enumerator to a generic enumerator.
public static IEnumerator<T> ToClassicEnumerator<TEnumerator, T>(this TEnumerator enumerator) where TEnumerator : struct, IEnumerator<TEnumerator, T>
Converts ad-hoc enumerator to a generic enumerator.
public static string ToString<T>(this IEnumerable<T> collection, string delimiter, string ifEmpty = "")
Concatenates each element from the collection into single string.