Table of Contents

Struct CsvOptions<T>.AotSafeConverters

Namespace
FlameCsv
Assembly
FlameCsv.Core.dll

Wrapper around Converters to provide AOT-safe access to converters.

[EditorBrowsable(EditorBrowsableState.Never)]
public readonly struct CsvOptions<T>.AotSafeConverters

Methods

GetConverter<TResult>()

Returns a converter for TResult.

[EditorBrowsable(EditorBrowsableState.Never)]
public CsvConverter<T, TResult> GetConverter<TResult>()

Returns

CsvConverter<T, TResult>

Type Parameters

TResult

Type to convert

Remarks

This API is meant to be used by the source generator to produce trimming/AOT safe code.
If a non-factory user defined converter is found, it is returned directly.
CsvConverterFactory<T> added to Converters are not supported.

Exceptions

CsvConverterMissingException

GetOrCreateEnum<TEnum>()

Returns an enum converter, falling back to the built-in one if UseDefaultConverters is true.

[EditorBrowsable(EditorBrowsableState.Never)]
public CsvConverter<T, TEnum> GetOrCreateEnum<TEnum>() where TEnum : struct, Enum

Returns

CsvConverter<T, TEnum>

Type Parameters

TEnum

Remarks

This API is meant to be used by the source generator to produce trimming/AOT safe code.
If a non-factory user defined converter is found, it is returned directly.

GetOrCreateNullable<TValue>(Func<CsvOptions<T>, CsvConverter<T, TValue>>, bool)

Returns a nullable converter, falling back to the built-in one if UseDefaultConverters is true.

[EditorBrowsable(EditorBrowsableState.Never)]
public CsvConverter<T, TValue?> GetOrCreateNullable<TValue>(Func<CsvOptions<T>, CsvConverter<T, TValue>> factory, bool canCache) where TValue : struct

Parameters

factory Func<CsvOptions<T>, CsvConverter<T, TValue>>
canCache bool

Returns

CsvConverter<T, TValue?>

Type Parameters

TValue

Remarks

This API is meant to be used by the source generator to produce trimming/AOT safe code.
If a non-factory user defined converter is found, it is returned directly.

GetOrCreate<TValue>(Func<CsvOptions<T>, CsvConverter<T, TValue>>, bool)

Returns a converter for TValue, either a configured one or from the factory.

[EditorBrowsable(EditorBrowsableState.Never)]
public CsvConverter<T, TValue> GetOrCreate<TValue>(Func<CsvOptions<T>, CsvConverter<T, TValue>> factory, bool canCache)

Parameters

factory Func<CsvOptions<T>, CsvConverter<T, TValue>>
canCache bool

Returns

CsvConverter<T, TValue>

Type Parameters

TValue

Remarks

This API is meant to be used by the source generator to produce trimming/AOT safe code.
If a non-factory user defined converter is found, it is returned directly.