package ocamlformat-rpc

  1. Overview
  2. Docs
module IO : sig ... end
module V : sig ... end
type state =
  1. | Waiting_for_version
  2. | Version_defined of Ocamlformat_rpc_lib.Version.t * Ocamlformat.Conf.t
include sig ... end
module type Command_S = sig ... end
module type Client_S = sig ... end
module Init : sig ... end
module V1 : sig ... end
module V2 : sig ... end
type client = [
  1. | `V1 of V1.Client.t
  2. | `V2 of V2.Client.t
]
val pick_client : pid:int -> IO.ic -> IO.oc -> string list -> (client, [ `Msg of string ]) result IO.t
val pid : client -> int
val halt : client -> (unit, [> `Msg of string ]) result IO.t
val config : (string * string) list -> client -> (unit, [> `Msg of string ]) result IO.t
val run_format : Ocamlformat.Conf.t -> Ocamlformat_stdlib.string -> ([> `Format of Ocamlformat_stdlib.string ], [> `Format_error of string ]) Ocamlformat_stdlib.result
val run_format_with_args : Ocamlformat_rpc_lib.format_args -> Ocamlformat.Conf.t -> Ocamlformat_stdlib.string -> ([> `Format of Ocamlformat_stdlib.string ], [> `Config_error of Ocamlformat.Config_option.Error.t | `Format_error of string | `Path_error of Ocamlformat_stdlib.string ]) Ocamlformat_stdlib.Result.t
val handle_format_error : 'a -> (Ocamlformat_stdlib.Out_channel.t -> [> `Error of 'a ] -> 'b) -> Base.unit
val handle_path_error : 'a -> (Ocamlformat_stdlib.Out_channel.t -> [> `Error of 'a ] -> 'b) -> Base.unit
val handle_config_error : Ocamlformat.Config_option.Error.t -> (Ocamlformat_stdlib.Out_channel.t -> [> `Error of string ] -> 'a) -> Base.unit
val handle_error : [< `Config_error of Ocamlformat.Config_option.Error.t | `Format_error of string | `Path_error of string ] -> (Ocamlformat_stdlib.Out_channel.t -> [> `Error of string ] -> 'a) -> Base.unit
val rpc_main : state -> (unit, 'a) Ocamlformat_stdlib.result
val run : unit -> (unit, 'a) Ocamlformat_stdlib.result