Page
Library
Module
Module type
Parameter
Class
Class type
Source
Ocamlformat_rpc_lib.MakeSourceVersion used to set the protocol version
val pick_client :
pid:int ->
IO.ic ->
IO.oc ->
string list ->
(client, [ `Msg of string ]) result IO.tThe RPC offers multiple versions of the API. pick_client ~pid in out versions handles the interaction with the server to agree with a common version of the RPC to use. Trying successively each version of the provided list versions until the server agrees, for this reason you might want to list newer versions before older versions. The given IO.ic and IO.oc values are referenced by the client value and must be kept open until halt is called.
Tell the server to close the connection. No more commands can be sent using the same client value.
val format :
?format_args:format_args ->
string ->
client ->
(string, [> `Msg of string ]) result IO.tformat_args modifies the server's configuration temporarily, for the current request.
A basic interaction could be:
RPC.config [("profile", "ocamlformat")] client >>= fun () ->
RPC.format "let x = 4 in x" client >>= fun formatted ->
...
RPC.halt client >>= fun () ->
...