package octez-libs

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

Module Tezos_rpc.ArgSource

Sourcetype ('i, 'j) eq = ('i, 'j) Resto.eq =
  1. | Eq : ('a, 'a) eq
include module type of struct include Resto.Arg end
Sourcetype 'a t = 'a Resto.Arg.t

The type of an argument.

Sourcetype 'a arg = 'a t
Sourceval 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).

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

descr is a type for the documentation of a t.

Sourceval descr : 'a arg -> descr

descr t is the documentation of t.

Sourceval bool : bool arg

bool is an argument for boolean values. The strings "yes", "y", "true", and "t", as well as all capitalisation variation thereof, all parsed to true. The strings "no", "n", "false", and "f", as well as all capitalisation variation thereof, all parsed to false. All other strings fail to parse.

Sourceval int : int arg

int is an argument for integer values. The parsing is identical to that of Stdlib.int_of_string -- refer to that function's documentation.

Sourceval int32 : int32 arg

int32 is an argument for 32-bit integer values. The parsing is identical to that of Int32.of_string -- refer to that function's documentation.

Sourceval int64 : int64 arg

int64 is an argument for 64-bit integer values. The parsing is identical to that of Int64.of_string -- refer to that function's documentation.

Sourceval float : float arg

float is an argument for floating-point decimal values. The parsing is identical to that of Float.of_string -- refer to that function's documentation.

Sourceval string : string arg

string is an argument for string values. No parsing is done.

Sourceval like : 'a arg -> ?descr:string -> string -> 'a arg

like a ?descr name is a new argument which carries the same type parameter and uses the same constructor/destructor functions as a, but has a different name and description. It is intended to be used to give different meaning to isomorphic arguments. E.g.,

let date = make ~descr:"A date in YYYY-MM-DD format" ~name:"date" ~destruct:(fun s -> ..) ~construct:(fun d -> ..) () in let birth_date = like date ~descr:"A date of birth in the YYYY-MM-DD format" "birth-date" in ..

Sourceval eq : 'a arg -> 'b arg -> ('a, 'b) Resto.eq option

eq a b is Some Eq if a and b are the same and None otherwise.

Note that eq a (like a ..) is always None.

Sourceval uint : int arg

uint is the same as int except that negative numbers are rejected.

Sourceval uint31 : int32 arg

uint31 is the same as int32 except that negative numbers are rejected.

Sourceval uint63 : int64 arg

uint63 is the same as int64 except that negative numbers are rejected.

Sourceval eq_descr : descr -> descr -> bool
OCaml

Innovation. Community. Security.