Module Persistent.Rpc

type 'state t
val create_blocking : ?on_keyboard_interrupt:(unit -> unit) -> here:lexing_position -> string -> type_:'fn Vcaml.Ocaml_from_nvim.Blocking.t -> f: ('state -> run_in_background: (here:lexing_position -> ([ `asynchronous ] Vcaml.Client.t -> unit Async.Deferred.Or_error.t) -> unit) -> client:[ `blocking ] Vcaml.Client.t -> 'fn) -> 'state t

This is a wrapper around Ocaml_from_nvim.register_request_blocking. See its documentation to understand the arguments here.

val create_async : here:lexing_position -> string -> type_:'fn Vcaml.Ocaml_from_nvim.Async.t -> f:('state -> client:[ `asynchronous ] Vcaml.Client.t -> 'fn) -> 'state t

This is a wrapper around Ocaml_from_nvim.register_request_async. See its documentation to understand the arguments here.

val contra_map : 'a t -> f:('b -> 'a) -> 'b t

Given an RPC that takes an 'a state and a way to produce a 'a from a 'b, return an RPC that takes a 'b state that when called will convert the state to 'a and invoke the original RPC.