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