module Descr:sig..end
Type descriptor for safe unmarshalling.
This module provides a safe API on top of modules Unmarshal of
Structural_descr, using module Type. This module offers the same
power as Unmarshal, but in a safe way.
type 'a t
Type of a type descriptor.
val t_unit : unit t
val t_int : int t
val t_string : string t
val t_float : float t
val t_bool : bool t
val t_int32 : int32 t
val t_int64 : int64 t
val t_nativeint : nativeint t
val unmarshable : 'a tDescriptor for unmarshallable types.
val is_unmarshable : 'a t -> boolval is_abstract : 'a t -> boolexception Invalid_descriptor
val t_record : Structural_descr.pack array -> 'a -> 'a tType descriptor for records (the length of the array must be equal to the number of fields in the record).
Invalid_descriptor if the descriptor cannot be built.val t_tuple : Structural_descr.pack array -> 'a -> 'a tType descriptor for tuples of any range (the length of the array range is the range of the tuple).
Invalid_descriptor if the descriptor cannot be built.val t_pair : 'a t -> 'b t -> ('a * 'b) tType descriptor for pairs (2-tuples).
Safer that t_tuple for pairs.
Invalid_descriptor if the descriptor cannot be built.val t_list : 'a t -> 'a list tType descriptor for lists.
Invalid_descriptor if the descriptor cannot be built.val t_ref : 'a t -> 'a Stdlib.ref tType descriptor for references.
Invalid_descriptor if the descriptor cannot be built.val t_option : 'a t -> 'a option tType descriptor for options.
Invalid_descriptor if the descriptor cannot be built.val t_queue : 'a t -> 'a Stdlib.Queue.t tType descriptor for queues.
Invalid_descriptor if the descriptor cannot be built.val of_type : 'a Type.t -> 'a tType descriptor from the type value.
val of_structural : 'a Type.t -> Structural_descr.t -> 'a tType descriptor from the structural descriptor. The given type value ensures safety.
Unmarshal's transformersval dependent_pair : 'a t -> ('a -> 'b t) -> ('a * 'b) tSimilar to Unmarshal.Dependent_pair, but safe.
Invalid_descriptor if the descriptor cannot be built.val transform : 'a t -> ('a -> 'a) -> 'a tSimilar to Unmarshal.Transform, but safe.
Invalid_descriptor if the given descriptor is incorrect.val return : 'a t -> (unit -> 'a) -> 'a tSimilar to Unmarshal.Return, but safe.
Invalid_descriptor if the descriptor cannot be built.val dynamic : (unit -> 'a t) -> 'a tSimilar to Unmarshal.Dynamic.
Invalid_descriptor if the descriptor cannot be built.val str : 'a t -> Structural_descr.tInvalid_descriptor if the given descriptor is incorrect.val pack : 'a t -> Structural_descr.packval input_val : Stdlib.in_channel -> 'a t -> 'a