Interface IFunctionTypeShape<TFunction, TArgumentState, TResult>
- Namespace
- PolyType.Abstractions
- Assembly
- PolyType.dll
Provides a strongly typed shape model for function types.
public interface IFunctionTypeShape<TFunction, TArgumentState, TResult> : ITypeShape<TFunction>, IFunctionTypeShape, ITypeShape
Type Parameters
TFunction
The type of the function.
TArgumentState
The mutable state type used for aggregating function arguments.
TResult
The return type of the underlying function.
- Inherited Members
Remarks
A function type shape represents a delegate type or an F# function type.
Properties
ReturnType
Gets the shape of the return type of the method.
ITypeShape<TResult> ReturnType { get; }
Property Value
- ITypeShape<TResult>
Methods
FromAsyncDelegate(RefFunc<TArgumentState, ValueTask<TResult>>)
Wraps a generic user-defined delegate into an instance of TFunction
.
TFunction FromAsyncDelegate(RefFunc<TArgumentState, ValueTask<TResult>> innerFunc)
Parameters
Returns
- TFunction
A strongly typed delegate of arbitrary arity.
Exceptions
- InvalidOperationException
The underlying delegate is not asynchronous.
FromDelegate(RefFunc<TArgumentState, TResult>)
Wraps a generic user-defined delegate into an instance of TFunction
.
TFunction FromDelegate(RefFunc<TArgumentState, TResult> innerFunc)
Parameters
innerFunc
RefFunc<TArgumentState, TResult>The user-defined delegate to wrap.
Returns
- TFunction
A strongly typed delegate of arbitrary arity.
Exceptions
- InvalidOperationException
The underlying delegate is asynchronous.
GetArgumentStateConstructor()
Gets a delegate for creating a default argument state instance.
Func<TArgumentState> GetArgumentStateConstructor()
Returns
- Func<TArgumentState>
A delegate for creating an argument state instance with default parameter values.
Exceptions
- InvalidOperationException
The Parameters property of the method is empty.
GetFunctionInvoker()
Gets a delegate for invoking the function with the provided argument state.
MethodInvoker<TFunction, TArgumentState, TResult> GetFunctionInvoker()
Returns
- MethodInvoker<TFunction, TArgumentState, TResult>
A MethodInvoker<TDeclaringType, TArgumentState, TResult> delegate.