package rpc

  1. Overview
  2. Docs

This module generates Client modules from RPC declarations

Parameters

Signature

type implementation = unit
type rpcfn = Rpc.call -> Rpc.response

The result of declaring a function of type 'a (where for example 'a might be (int -> string -> bool)), is a function that takes an rpc function, which might send the RPC across the network, and returns a function of type 'a, in this case (int -> string -> bool).

type 'a res = rpcfn -> 'a
type ('a, 'b) comp = ('a, 'b) Result.result

Our functions return a Result.result type, which contains the result of the Rpc, which might be an error message indicating a problem happening on the remote end.

type _ fn
val (@->) : 'a Param.t -> 'b fn -> ('a -> 'b) fn
val returning : 'a Param.t -> 'b Error.t -> ('a, 'b) comp fn
val declare : string -> string list -> 'a fn -> rpcfn -> 'a
OCaml

Innovation. Community. Security.