Struct Supplier<T, TResult>
Represents typed function pointer implementing ISupplier<T, TResult>.
Inherited Members
Namespace: DotNext
Assembly: DotNext.dll
Syntax
[CLSCompliant(false)]
public readonly struct Supplier<T, TResult> : ISupplier<T, TResult>, IFunctional<Func<T, TResult>>
Type Parameters
Name | Description |
---|---|
T | The type of the argument. |
TResult | The type of the result. |
Remarks
Wraps the function pointer.
Constructors
| Edit this page View SourceSupplier(delegate*<T, TResult>)
Represents typed function pointer implementing ISupplier<T, TResult>.
Declaration
public Supplier(delegate*<T, TResult> ptr)
Parameters
Type | Name | Description |
---|---|---|
delegate*<T, TResult> | 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 supplier to the delegate of type Func<T, TResult>.
Declaration
public Func<T, TResult> ToDelegate()
Returns
Type | Description |
---|---|
Func<T, TResult> | 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 Func<T, TResult>(Supplier<T, TResult>)
Converts this supplier to the delegate of type Func<T, TResult>.
Declaration
public static explicit operator Func<T, TResult>(Supplier<T, TResult> supplier)
Parameters
Type | Name | Description |
---|---|---|
Supplier<T, TResult> | supplier | The value representing the pointer to the method. |
Returns
Type | Description |
---|---|
Func<T, TResult> | The delegate representing the wrapped method. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
implicit operator Supplier<T, TResult>(delegate*<T, TResult>)
Wraps the function pointer.
Declaration
public static implicit operator Supplier<T, TResult>(delegate*<T, TResult> ptr)
Parameters
Type | Name | Description |
---|---|---|
delegate*<T, TResult> | ptr | The pointer to the managed method. |
Returns
Type | Description |
---|---|
Supplier<T, TResult> | The typed function pointer. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|