rpclib

A library to deal with RPCs in OCaml

Value

type t =
| Int of int64
| Int32 of int32
| Bool of bool
| Float of float
| String of string
| DateTime of string
| Enum of t list
| Dict of (string * t) list
| Base64 of string
| Null
val to_string : t -> string
module Version : sig ... end
module Types : sig ... end

Basic constructors

val rpc_of_int64 : int64 -> t
val rpc_of_int32 : int32 -> t
val rpc_of_int : int -> t
val rpc_of_bool : bool -> t
val rpc_of_float : float -> t
val rpc_of_string : string -> t
val rpc_of_dateTime : string -> t
val rpc_of_base64 : string -> t
val rpc_of_t : t -> t
val rpc_of_unit : unit -> t
val rpc_of_char : char -> t
val int64_of_rpc : t -> int64
val int32_of_rpc : t -> int32
val int_of_rpc : t -> int
val bool_of_rpc : t -> bool
val float_of_rpc : t -> float
val string_of_rpc : t -> string
val dateTime_of_rpc : t -> string
val base64_of_rpc : t -> string
val t_of_rpc : t -> t
val char_of_rpc : t -> char
val unit_of_rpc : t -> unit
module ResultUnmarshallers : sig ... end

Calls

type callback = string list -> t -> unit
type call = {
name : string;
params : t list;
is_notification : bool;
}
val call : string -> t list -> call
val notification : string -> t list -> call
val string_of_call : call -> string

Responses

type response = {
success : bool;
contents : t;
is_notification : bool;
}
val string_of_response : response -> string
val success : t -> response
val failure : t -> response

Run-time errors

exception Runtime_error of string * t
exception Runtime_exception of string * string
val set_debug : bool -> unit

Debug options

val get_debug : unit -> bool
val lowerfn : t -> t

Helper

val struct_extend : t -> t -> t

struct_extend rpc1 rpc2 first checks that rpc1 and rpc2 are both * dictionaries. If this is the case then struct_extend will create a new * Rpc.t which contains all key-value pairs from rpc1, as well as all * key-value pairs from rpc2 for which the key does not exist in rpc1.