package ezresto

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Arguments are documented serializers-deserializers for parameters.

type 'a t = 'a Resto.Arg.arg

The type of an argument.

type 'a arg = 'a t
val make : ?descr:string -> name:string -> destruct:(string -> ('a, string) result) -> construct:('a -> string) -> unit -> 'a arg

make ?descr ~name ~destruct ~construct () is an argument. The values of descr and name are used for documentation purpose only. The values of destruct and construct are used for conversion from/to strings. Note that it is expected that destruct and construct round-trip (modulo the result error wrapping).

type descr = Resto.Arg.descr = {
  1. name : string;
  2. descr : string option;
}

descr is a type for the documentation of a t.

val descr : 'a arg -> descr

descr t is the documentation of t.

val int : int arg

int, int32, int64, float, and string are arguments for the corresponding built-in types of OCaml.

val int32 : int32 arg
val int64 : int64 arg
val float : float arg
val string : string arg
OCaml

Innovation. Community. Security.