resto

A minimal OCaml library for type-safe HTTP/JSON RPCs
IN THIS PACKAGE
module Ty : sig ... end
type 'a arg = {
id : 'a Ty.id;
destruct : string -> ( 'a, string ) result;
construct : 'a -> string;
descr : Arg.descr;
}
val from_arg : 'a arg -> 'a Arg.t
val to_arg : 'a Arg.t -> 'a arg
type (_, _) path =
| Root : ( 'rkey, 'rkey ) path
| Static : ( 'rkey, 'key ) path * string -> ( 'rkey, 'key ) path
| Dynamic : ( 'rkey, 'key ) path * 'a arg -> ( 'rkey, 'key * 'a ) path
| DynamicTail : ( 'rkey, 'key ) path * 'a arg -> ( 'rkey, 'key * 'a list ) path
val from_path : ( 'a, 'b ) path -> ( 'a, 'b ) Path.t
val to_path : ( 'a, 'b ) Path.t -> ( 'a, 'b ) path
type 'a query =
| Fields : ( 'a, 'b ) query_fields * 'b -> 'a query
and ('a, 'b) query_fields =
| F0 : ( 'a, 'a ) query_fields
| F1 : ( 'a, 'b ) query_field * ( 'a, 'c ) query_fields -> ( 'a, 'b -> 'c ) query_fields
and ('a, 'b) query_field =
| Single : {
name : string;
description : string option;
ty : 'b arg;
default : 'b;
get : 'a -> 'b;
} -> ( 'a, 'b ) query_field
| Opt : {
name : string;
description : string option;
ty : 'b arg;
get : 'a -> 'b option;
} -> ( 'a, 'b option ) query_field
| Flag : {
name : string;
description : string option;
get : 'a -> bool;
} -> ( 'a, bool ) query_field
| Multi : {
name : string;
description : string option;
ty : 'b arg;
get : 'a -> 'b list;
} -> ( 'a, 'b list ) query_field
val from_query : 'a query -> 'a Query.t
val to_query : 'a Query.t -> 'a query
val field_name : ( 'a, 'b ) query_field -> string
val field_description : ( 'a, 'b ) query_field -> string option
val field_kind : ( 'a, 'b ) query_field -> Description.query_kind
type ('query, 'input, 'output, 'error) types = {
query : 'query Query.t;
input : 'input input;
output : 'output Encoding.t;
error : 'error Encoding.t;
}
type (+'meth, 'prefix, 'params, 'query, 'input, 'output, 'error) iservice = {
description : string option;
meth : 'meth;
path : ( 'prefix, 'params ) path;
types : ( 'query, 'input, 'output, 'error ) types;
} constraint 'meth = [< meth ]
exception Not_equal
type (_, _) eq =
| Eq : ( ( 'query, 'input, 'output, 'error ) types, ( 'query, 'input, 'output, 'error ) types ) eq
val eq : ( 'query1, 'input1, 'output1, 'error1 ) types -> ( 'query2, 'input2, 'output2, 'error2 ) types -> ( ( 'query1, 'input1, 'output1, 'error1 ) types, ( 'query2, 'input2, 'output2, 'error2 ) types ) eq
val from_service : ( 'meth, 'prefix, 'params, 'query, 'input, 'output, 'error ) iservice -> ( 'meth, 'prefix, 'params, 'query, 'input, 'output, 'error ) service
val to_service : ( 'meth, 'prefix, 'params, 'query, 'input, 'output, 'error ) service -> ( 'meth, 'prefix, 'params, 'query, 'input, 'output, 'error ) iservice