Class AheadOfTimeTypeDescriber
An ITypeDescriber that use (de)serializer that was generated ahead of time
by using Cesil.SourceGenerator.
Inheritance
System.Object
AheadOfTimeTypeDescriber
Namespace: Cesil
Assembly: Cesil.dll
Syntax
public sealed class AheadOfTimeTypeDescriber : Object, ITypeDescriber, IEquatable<AheadOfTimeTypeDescriber>
Constructors
AheadOfTimeTypeDescriber()
Create a new AheadOfTimeTypeDescriber.
Note that a pre-allocated instance is also available on TypeDescribers.
Declaration
public AheadOfTimeTypeDescriber()
Methods
EnumerateMembersToDeserialize(TypeInfo)
Enumerate members which will be deserialized for the given type.
Note that these members are generated ahead of time with a source gneerator,
and cannot be changed at runtime.
Declaration
public IEnumerable<DeserializableMember> EnumerateMembersToDeserialize(TypeInfo forType)
Parameters
Type |
Name |
Description |
System.Reflection.TypeInfo |
forType |
|
Returns
EnumerateMembersToSerialize(TypeInfo)
Enumerate members which will be serialized for the given type.
Note that these members are generated ahead of time with a source gneerator,
and cannot be changed at runtime.
Declaration
public IEnumerable<SerializableMember> EnumerateMembersToSerialize(TypeInfo forType)
Parameters
Type |
Name |
Description |
System.Reflection.TypeInfo |
forType |
|
Returns
Equals(AheadOfTimeTypeDescriber)
Returns true if this and the given AheadOfTimeTypeDescribers are equal
Declaration
public bool Equals(AheadOfTimeTypeDescriber typeDescriber)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Equals(Object)
Returns true if this AheadOfTimeTypeDescriber equals the given object
Declaration
public override bool Equals(object obj)
Parameters
Type |
Name |
Description |
System.Object |
obj |
|
Returns
Type |
Description |
System.Boolean |
|
GetCellsForDynamicRow(WriteContext, Object, Span<DynamicCellValue>)
This operation is not supported with AheadOfTimeTypeDescriber
Declaration
public int GetCellsForDynamicRow(in WriteContext context, object row, Span<DynamicCellValue> cells)
Parameters
Returns
Type |
Description |
System.Int32 |
|
GetDynamicCellParserFor(ReadContext, TypeInfo)
This operation is not supported with AheadOfTimeTypeDescriber
Declaration
public Parser GetDynamicCellParserFor(in ReadContext context, TypeInfo targetType)
Parameters
Type |
Name |
Description |
ReadContext |
context |
|
System.Reflection.TypeInfo |
targetType |
|
Returns
GetDynamicRowConverter(ReadContext, IEnumerable<ColumnIdentifier>, TypeInfo)
This operation is not supported with AheadOfTimeTypeDescriber
Declaration
public DynamicRowConverter GetDynamicRowConverter(in ReadContext context, IEnumerable<ColumnIdentifier> columns, TypeInfo targetType)
Parameters
Type |
Name |
Description |
ReadContext |
context |
|
System.Collections.Generic.IEnumerable<ColumnIdentifier> |
columns |
|
System.Reflection.TypeInfo |
targetType |
|
Returns
GetHashCode()
Returns a hash code for this AheadOfTimeTypeDescriber
Declaration
public override int GetHashCode()
Returns
Type |
Description |
System.Int32 |
|
GetInstanceProvider(TypeInfo)
Returns an InstanceProvider that can be used to create new instance of the given type
while deserializing.
Note that this InstanceProvider is generated ahead of time with a source gneerator,
and cannot be changed at runtime.
Declaration
public InstanceProvider GetInstanceProvider(TypeInfo forType)
Parameters
Type |
Name |
Description |
System.Reflection.TypeInfo |
forType |
|
Returns
ToString()
Returns a representation of this AheadOfTimeTypeDescriber object.
Only for debugging, this value is not guaranteed to be stable.
Declaration
public override string ToString()
Returns
Type |
Description |
System.String |
|
Operators
Equality(AheadOfTimeTypeDescriber, AheadOfTimeTypeDescriber)
Compare two AheadOfTimeTypeDescribers for equality
Declaration
public static bool operator ==(AheadOfTimeTypeDescriber a, AheadOfTimeTypeDescriber b)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Inequality(AheadOfTimeTypeDescriber, AheadOfTimeTypeDescriber)
Compare two AheadOfTimeTypeDescribers for inequality
Declaration
public static bool operator !=(AheadOfTimeTypeDescriber a, AheadOfTimeTypeDescriber b)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Explicit Interface Implementations
ITypeDescriber.GetCellsForDynamicRow(WriteContext, Object, Span<DynamicCellValue>)
Declaration
int ITypeDescriber.GetCellsForDynamicRow(in WriteContext context, object row, Span<DynamicCellValue> cells)
Parameters
Returns
Type |
Description |
System.Int32 |
|
ITypeDescriber.GetDynamicCellParserFor(ReadContext, TypeInfo)
Declaration
Parser ITypeDescriber.GetDynamicCellParserFor(in ReadContext context, TypeInfo targetType)
Parameters
Type |
Name |
Description |
ReadContext |
context |
|
System.Reflection.TypeInfo |
targetType |
|
Returns
ITypeDescriber.GetDynamicRowConverter(ReadContext, IEnumerable<ColumnIdentifier>, TypeInfo)
Declaration
DynamicRowConverter ITypeDescriber.GetDynamicRowConverter(in ReadContext context, IEnumerable<ColumnIdentifier> columns, TypeInfo targetType)
Parameters
Type |
Name |
Description |
ReadContext |
context |
|
System.Collections.Generic.IEnumerable<ColumnIdentifier> |
columns |
|
System.Reflection.TypeInfo |
targetType |
|
Returns
Implements
System.IEquatable<>