Show / Hide Table of Contents

Struct Consumer<T>

Represents typed function pointer implementing IConsumer<T>.

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

The type of the consumer argument.

Remarks

Wraps the function pointer.

Constructors

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

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

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

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.

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

Extension Methods

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