Show / Hide Table of Contents

Struct Consumer<T>

Represents typed function pointer implementing IConsumer<T>.

Implements
IConsumer<T>
IFunctional<Action<T>>
Inherited Members
ValueType.Equals(object)
ValueType.GetHashCode()
object.Equals(object, object)
object.GetType()
object.ReferenceEquals(object, object)
Namespace: DotNext
Assembly: DotNext.dll
Syntax
[CLSCompliant(false)]
public readonly struct Consumer<T> : IConsumer<T>, IFunctional<Action<T>>
Type Parameters
Name Description
T

The type of the consumer argument.

Remarks

Wraps the function pointer.

Constructors

| Edit this page View Source

Consumer(delegate*<T, void>)

Represents typed function pointer implementing IConsumer<T>.

Declaration
public Consumer(delegate*<T, void> ptr)
Parameters
Type Name Description
delegate*<T, void> ptr

The function pointer.

Remarks

Wraps the function pointer.

Exceptions
Type Condition
ArgumentNullException

ptr is zero.

Properties

| Edit this page View Source

IsEmpty

Gets a value indicating that this function pointer is zero.

Declaration
public bool IsEmpty { get; }
Property Value
Type Description
bool
Exceptions
Type Condition
ArgumentNullException

ptr is zero.

Methods

| Edit this page View Source

ToDelegate()

Converts this consumer to the delegate of type Action<T>.

Declaration
public Action<T> ToDelegate()
Returns
Type Description
Action<T>

The delegate representing the wrapped method.

Exceptions
Type Condition
ArgumentNullException

ptr is zero.

| Edit this page View Source

ToString()

Gets hexadecimal representation of this pointer.

Declaration
public override string ToString()
Returns
Type Description
string

Hexadecimal representation of this pointer.

Overrides
ValueType.ToString()
Exceptions
Type Condition
ArgumentNullException

ptr is zero.

Operators

| Edit this page View Source

explicit operator Action<T>(Consumer<T>)

Converts this consumer to the delegate of type Action<T>.

Declaration
public static explicit operator Action<T>(Consumer<T> consumer)
Parameters
Type Name Description
Consumer<T> consumer

The value representing the pointer to the method.

Returns
Type Description
Action<T>

The delegate representing the wrapped method.

Exceptions
Type Condition
ArgumentNullException

ptr is zero.

| Edit this page View Source

implicit operator Consumer<T>(delegate*<T, void>)

Wraps the function pointer.

Declaration
public static implicit operator Consumer<T>(delegate*<T, void> ptr)
Parameters
Type Name Description
delegate*<T, void> ptr

The pointer to the managed method.

Returns
Type Description
Consumer<T>

The typed function pointer.

Exceptions
Type Condition
ArgumentNullException

ptr is zero.

Implements

IConsumer<T>
IFunctional<TDelegate>

Extension Methods

BasicExtensions.IsBetween<T, TLowerBound, TUpperBound>(T, TLowerBound, TUpperBound)
BasicExtensions.IsOneOf<T>(T, ReadOnlySpan<T>)
Collection.ToAsyncEnumerator<TEnumerator, T>(TEnumerator, CancellationToken)
Collection.ToClassicEnumerator<TEnumerator, T>(TEnumerator)
Enumerator.Skip<TEnumerator, T>(ref TEnumerator, int)
ExpressionBuilder.Const<T>(T)
  • Edit this page
  • View Source
☀
☾
In this article
Back to top
Supported by the .NET Foundation
☀
☾