package vcaml

  1. Overview
  2. Docs
OCaml bindings for the Neovim API

Install

Dune Dependency

Authors

Maintainers

Sources

vcaml-v0.16.0.tar.gz
sha256=dd123302c46af7ca6eda8a7806c78236fd217a8c73a2e1cd7da85f1d69ed1ae4

doc/vcaml.msgpack_rpc/Msgpack_rpc/index.html

Module Msgpack_rpcSource

Implements the Msgpack RPC protocol. See https://github.com/msgpack-rpc/msgpack-rpc/blob/master/spec.md

Sourcemodule Event : sig ... end
Sourcemodule Error : sig ... end
Sourcetype 'state t
Sourceval create : on_error:(Error.t -> Base.unit) -> [ `not_connected ] t
Sourceval notifications : _ t -> (Event.t -> Base.unit) Bus.Read_only.t

Although you can still subscribe after the RPC is connected, note that if you do you may miss events sent before the subscription.

Sourceval register_method : _ t -> name:Base.string -> f:(Msgpack.t Base.list -> Msgpack.t Async_kernel.Deferred.Or_error.t) -> [ `Ok | `Duplicate ]

Although you can still register methods after the RPC is connected, note that if clients call the method before registration they will see an error for an undefined method.

Sourceval connect : [ `not_connected ] t -> Async.Reader.t -> Async.Writer.t -> close_reader_and_writer_on_disconnect:Base.bool -> [ `connected ] t

Once connect is called the counterparty can start calling methods and sending notifications. Any methods that should be callable at that time should be registered beforehand, as should any subscriptions to the event bus. Calling connect twice will raise.

Sourceval reader : [ `connected ] t -> Async.Reader.t
Sourceval writer : [ `connected ] t -> Async.Writer.t
Sourceval call : [ `connected ] t -> method_name:Base.string -> parameters:Msgpack.t Base.list -> (Msgpack.t, Msgpack.t) Async_kernel.Deferred.Result.t
Sourceval notify : [ `connected ] t -> method_name:Base.string -> parameters:Msgpack.t Base.list -> Base.unit
OCaml

Innovation. Community. Security.