Class SourceGenFunctionTypeShape<TFunction, TArgumentState, TResult>
- Namespace
- PolyType.SourceGenModel
- Assembly
- PolyType.dll
Source generator model for function type shapes.
public sealed class SourceGenFunctionTypeShape<TFunction, TArgumentState, TResult> : SourceGenTypeShape<TFunction>, IFunctionTypeShape<TFunction, TArgumentState, TResult>, ITypeShape<TFunction>, IFunctionTypeShape, ITypeShape where TArgumentState : IArgumentState
Type Parameters
TFunction
The function type.
TArgumentState
The mutable state type used for aggregating function arguments.
TResult
The return type of the underlying method.
- Inheritance
-
SourceGenTypeShape<TFunction>SourceGenFunctionTypeShape<TFunction, TArgumentState, TResult>
- Implements
-
IFunctionTypeShape<TFunction, TArgumentState, TResult>ITypeShape<TFunction>
- Inherited Members
Properties
ArgumentStateConstructor
Gets a delegate for creating argument state constructor.
public required Func<TArgumentState> ArgumentStateConstructor { get; init; }
Property Value
- Func<TArgumentState>
CreateParametersFunc
Gets a factory method for creating parameter shapes.
public Func<IEnumerable<IParameterShape>>? CreateParametersFunc { get; init; }
Property Value
FromAsyncDelegateFunc
Gets a delegate wrapping a generic user-defined async delegate into an instance of TFunction
.
public Func<RefFunc<TArgumentState, ValueTask<TResult>>, TFunction>? FromAsyncDelegateFunc { get; init; }
Property Value
FromDelegateFunc
Gets a delegate wrapping a generic user-defined delegate into an instance of TFunction
.
public Func<RefFunc<TArgumentState, TResult>, TFunction>? FromDelegateFunc { get; init; }
Property Value
FunctionInvoker
Gets a delegate for invoking the function.
public required MethodInvoker<TFunction, TArgumentState, TResult> FunctionInvoker { get; init; }
Property Value
- MethodInvoker<TFunction, TArgumentState, TResult>
IsAsync
public required bool IsAsync { get; init; }
Property Value
IsVoidLike
public required bool IsVoidLike { get; init; }
Property Value
Remarks
When true the ReturnType is reported as Unit,
Kind
Gets determines the TypeShapeKind that the current shape supports.
public override TypeShapeKind Kind { get; }
Property Value
Parameters
Gets the shapes of the parameters accepted by the method.
public IReadOnlyList<IParameterShape> Parameters { get; }
Property Value
ReturnType
Gets the shape of the return type of the method.
public required ITypeShape<TResult> ReturnType { get; init; }
Property Value
- ITypeShape<TResult>
Methods
Accept(TypeShapeVisitor, object?)
Accepts a TypeShapeVisitor for type graph traversal.
public override object? Accept(TypeShapeVisitor visitor, object? state = null)
Parameters
visitor
TypeShapeVisitorThe visitor to accept.
state
objectThe state parameter to pass to the underlying visitor.