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
TFunctionThe function type.
TArgumentStateThe mutable state type used for aggregating function arguments.
TResultThe 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>
FromAsyncDelegate
Gets a delegate wrapping a generic user-defined async delegate into an instance of TFunction.
public Func<RefFunc<TArgumentState, ValueTask<TResult>>, TFunction>? FromAsyncDelegate { get; init; }
Property Value
FromDelegate
Gets a delegate wrapping a generic user-defined delegate into an instance of TFunction.
public Func<RefFunc<TArgumentState, TResult>, TFunction>? FromDelegate { 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 bool IsAsync { get; init; }
Property Value
IsVoidLike
public 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
ParametersFactory
Gets a factory method for creating parameter shapes.
public Func<IEnumerable<IParameterShape>>? ParametersFactory { get; init; }
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
visitorTypeShapeVisitorThe visitor to accept.
stateobjectThe state parameter to pass to the underlying visitor.