Struct Consumer<T>
Represents typed function pointer implementing IConsumer<T>.
Inherited Members
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 SourceConsumer(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 |
|
Properties
| Edit this page View SourceIsEmpty
Gets a value indicating that this function pointer is zero.
Declaration
public bool IsEmpty { get; }
Property Value
Type | Description |
---|---|
bool |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Methods
| Edit this page View SourceToDelegate()
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 |
|
ToString()
Gets hexadecimal representation of this pointer.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string | Hexadecimal representation of this pointer. |
Overrides
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Operators
| Edit this page View Sourceexplicit 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 |
|
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 |
|