Legivel


Mapping

Namespace: Legivel.Customization

Nested types and modules

TypeDescription
DUFieldMapping
DiscriminatedUnionMappingInfo

Mapper structure for a Discriminated Union - non-enum

EnumFieldMapping
EnumMappingInfo

Mapper structure for a Discriminated Union, which compiles to an enum type

Error

Returned when deserialization contained errors

ListMappingInfo

Mapper structure for a List<'a> type

MapMappingInfo
OptionalMappingInfo

Mapper structure for an Option<'a> type

PrimitiveMappingInfo

Mapper structure for all primitive types

RecordFieldMapping

Contains the mapping of one record field

RecordMappingInfo

Mapper structure for a record type

Result<'tp>

Result of customized yaml to native mapping

ScalarToNativeMapping

To register one yaml scalar to native mapping

Success<'tp>

Returned when deserialization in succesful

ModuleDescription
YamlMapped

Functions and values

Function or valueDescription
BuildInTryFindMappers(po)
Signature: po:ProcessingOptions -> TryFindIdiomaticMapperForType list

All build-in TryFindMapper functions

CreateTypeMappings(...)
Signature: msgList:ProcessMessages -> tryFindMappers:TryFindIdiomaticMapperForType list -> nullTagUri:string -> stringTagUri:string -> TryFindMapperReturnType
Type parameters: 'tp

Creates a yaml-to-native-mapper for the given type 'tp

CustomDeserializeYaml(...)
Signature: tryFindMappers:TryFindIdiomaticMapperForType list -> mapYmlDocToNative:(ProcessMessages -> AllTryFindIdiomaticMappers -> IYamlToNativeMapping -> ParsedDocumentResult -> Result<'tp>) -> parseYmlToNative:((ParsedDocumentResult -> Result<'tp>) -> GlobalTagSchema -> string -> Result<'tp> list) -> schema:GlobalTagSchema -> nullTagUri:string -> stringTagUri:string -> yml:string -> Result<'tp> list
Type parameters: 'tp

Customized yaml deserialization, where one can inject everything required

MapYamlDocumentToNative(...)
Signature: msgList:ProcessMessages -> mappers:AllTryFindIdiomaticMappers -> mapper:IYamlToNativeMapping -> pdr:ParsedDocumentResult -> Result<'tp>
Type parameters: 'tp

Maps a (parsed) yaml document to a native type-instance, using the given mapper

ParseYamlToNative mapToNative schema yml
Signature: mapToNative:(ParsedDocumentResult -> Result<'tp>) -> schema:GlobalTagSchema -> yml:string -> Result<'tp> list
Type parameters: 'tp

Parses a yaml string, for the given yaml-schema and maps it to a native type instance

YamlScalarToNativeMappings
Signature: ScalarToNativeMapping list

All yaml-scalar to native mappings

Fork me on GitHub