DotNext by .NET Foundation and Contributors

<PackageReference Include="DotNext" Version="4.12.4" />

 IReadOnlySpanConsumer<T>

Represents functional interface returning no value and accepting the single argument of type ReadOnlySpan<T>.
using DotNext.Runtime.CompilerServices; using System; using System.Runtime.CompilerServices; using System.Threading; using System.Threading.Tasks; namespace DotNext.Buffers { [System.Runtime.CompilerServices.NullableContext(2)] public interface IReadOnlySpanConsumer<T> : ISupplier<ReadOnlyMemory<T>, CancellationToken, ValueTask>, IFunctional<Func<ReadOnlyMemory<T>, CancellationToken, ValueTask>> { void Invoke([System.Runtime.CompilerServices.Nullable(new byte[] { 0, 1 })] ReadOnlySpan<T> span); ValueTask ISupplier<ReadOnlyMemory<T>, CancellationToken, ValueTask>.Invoke(ReadOnlyMemory<T> input, CancellationToken token) { if (!token.IsCancellationRequested) { ValueTask result = default(ValueTask); try { Invoke(input.Span); return result; } catch (Exception exception) { return ValueTask.FromException(exception); } } return ValueTask.FromCanceled(token); } } }