package serde_derive

  1. Overview
  2. Docs
Derive-macros for the Serde serialization framework

Install

dune-project
 Dependency

Authors

Maintainers

Sources

serde-0.0.2.tbz
sha256=0766b13f1e9421f98fab8efc5d43657229f3b3bc13ca4722086da634fe076ca4
sha512=1023dcd53c4b69032f466b338e2f0146ee3443b2ec4ce8db2d1f226e1409d81a3da3767ac73e9e047fd61b904a829ff841c26317c8ea050351ba6f70ab4158c4

doc/serde_derive/Serde_derive/De/index.html

Module Serde_derive.DeSource

module Ast = Ppxlib.Ast_builder.Default
Sourceval loc : ctxt:Ppxlib.Expansion_context.Deriver.t -> Ppxlib__.Location.t

helpers

Sourceval var : ctxt:Ppxlib.Expansion_context.Deriver.t -> 'a -> 'a Ppxlib.Loc.t
Sourceval gensym : unit -> ctxt:Ppxlib.Expansion_context.Deriver.t -> string Ppxlib.Loc.t
Sourceval deserializer_fn_name_for_longident : Ppxlib.Longident.t Ppxlib.loc -> Ppxlib.Longident.t
Sourceval error_with_msg : loc:Ppxlib.location -> string -> Ppxlib_ast.Ast.expression
Sourceval is_primitive : string -> bool
Sourceval deserializer_for_type : ctxt:Ppxlib.Expansion_context.Deriver.t -> Ppxlib.Parsetree.core_type -> Ppxlib_ast.Ast.expression

deserializer_for_type creates a call to a deserializer based on a type.

When type is a constructor (or Ptyp_constr, which is OCaml for "any type name"), we will look at the number of arguments it has and

implementation

Sourcemodule Record_deserializer : sig ... end

Deserializes records in different ways.

Sourceval gen_deserialize_externally_tagged_variant_impl : ctxt:Ppxlib.Expansion_context.Deriver.t -> string Ppxlib.loc -> Attributes.type_attributes -> Ppxlib.Parsetree.constructor_declaration list -> Ppxlib_ast.Ast.expression
Sourceval gen_deserialize_adjacently_tagged_variant_impl : tag_field_name:string -> content_field_name:string -> ctxt:Ppxlib.Expansion_context.Deriver.t -> string Ppxlib.loc -> Attributes.type_attributes -> Ppxlib.Parsetree.constructor_declaration list -> Ppxlib_ast.Ast.expression
Sourceval gen_deserialize_internally_tagged_variant_impl : tag_field_name:'a -> ctxt:'b -> 'c -> 'd -> 'e -> 'f
Sourceval gen_deserialize_variant_impl : ctxt:Ppxlib.Expansion_context.Deriver.t -> string Ppxlib.loc -> Attributes.type_attributes -> Ppxlib.Parsetree.constructor_declaration list -> Ppxlib_ast.Ast.expression
Sourceval gen_deserialize_record_impl : ctxt:Ppxlib.Expansion_context.Deriver.t -> string Ppxlib.loc -> Attributes.type_attributes -> Ppxlib.label_declaration list -> Ppxlib_ast.Ast.expression

Generate the deserializer function for a record type.

See Record_deserializer above for more info.

Sourceval gen_deserialize_impl : ctxt:Ppxlib.Expansion_context.Deriver.t -> Ppxlib.type_declaration -> Ppxlib_ast.Ast.structure_item

Generates a deserializer implementation dispatching based on the kind of type that the @@deriving attribute was set on.

Sourceval generate_impl : ctxt:Ppxlib.Expansion_context.Deriver.t -> ('a * Ppxlib.type_declaration list) -> Ppxlib_ast.Ast.structure_item list
Sourceval impl_generator : (Ppxlib_ast.Ast.structure_item list, Ppxlib__.Import.rec_flag * Ppxlib.type_declaration list) Ppxlib__Deriving.Generator.t

interface

Sourceval generate_intf : ctxt:'a -> ('b * 'c) -> 'd list
Sourceval intf_generator : (Ppxlib__.Import.signature_item list, Ppxlib__.Import.rec_flag * Ppxlib__.Import.type_declaration list) Ppxlib__Deriving.Generator.t

registration

Sourceval register : Ppxlib.Deriving.t