Show / Hide Table of Contents

Interface IConsumer<T>

Represents functional interface returning no value and accepting the single argument.

Inherited Members
IFunctional.DynamicInvoke(scoped ref readonly Variant, int, scoped Variant)
IFunctional.GetArgument<T>(ref readonly Variant, int)
Namespace: DotNext
Assembly: DotNext.dll
Syntax
public interface IConsumer<in T> : IFunctional where T : allows ref struct
Type Parameters
Name Description
T

The type of the argument.

Remarks

Functional interface can be used to pass some application logic without heap allocation in contrast to regular delegates. Additionally, implementation of functional interface may have encapsulated data acting as closure which is not allocated on the heap.

Methods

View Source

Invoke(T)

Invokes the consumer.

Declaration
void Invoke(T arg)
Parameters
Type Name Description
T arg

The first argument.

Extension Methods

BasicExtensions.As<T>(T)
BasicExtensions.IsBetween<T, TLowerBound, TUpperBound>(T, TLowerBound, TUpperBound)
BasicExtensions.IsOneOf<T>(T, params ReadOnlySpan<T>)
  • View Source
☀
☾
In this article
Back to top
Supported by the .NET Foundation
☀
☾