package capnp-rpc
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=4b59a4147cf6e49c650dbfa4cdb918aec3be69cffd1ef6b5c818584464feb987
sha512=69114597e9cd8ad42c72c1751796b216f98f2a9f09f50a0628b4a3259c2f9b169fd47a73be7b76cfda298a6c202bc79762116865272e35ca0d0914242ace34d7
doc/capnp-rpc.proto/Capnp_rpc_proto/Local_struct_promise/Make/argument-1-C/index.html
Parameter Make.C
This module defines a calling convention for invoking methods on objects. The objects could be remote, but this module doesn't define anything related to networks. These types are generated automatically from WIRE by Core_types.
The core RPC logic can be used with different serialisation systems. The appropriate types should be provided here.
class type base_ref = object ... endCommon methods for struct_ref and cap.
val inc_ref : base_ref -> unitinc_ref x increases x's ref-count by one.
val dec_ref : base_ref -> unitdec_ref x decreases x's ref-count by one.
class type struct_ref = object ... endThe result of a call, which may not have arrived yet. It can be used to pipeline calls to capabilities that we hope will be returned in the results.
class type cap = object ... endA capability reference to an object that can handle calls. We might not yet know its final location, but we may be able to pipeline messages to it anyway.
class type struct_resolver = object ... endA struct_resolver can be used to resolve some promise.
module Attachments : sig ... endmodule Request_payload :
S.PAYLOAD
with type t = Wire.Request.t
and type cap := cap
and type path := Wire.Path.tThe payload of a request message.
module Response_payload :
S.PAYLOAD
with type t = Wire.Response.t
and type cap := cap
and type path := Wire.Path.tThe payload of a response message.
class virtual ref_counted : object ... endA mix-in to help with writing reference-counted objects. It will call self#release when the ref-count reaches zero.
class virtual service : object ... endA convenience base class for creating local services. The capability is always resolved, and the default release method does nothing.
val null : capA (broken) capability representing a missing pointer. Any attempt to call it will return an error.
val return : Response_payload.t -> struct_refreturn x is a resolved struct_ref with successful resolution x.
val fail :
?ty:Exception.ty ->
('a, Format.formatter, unit, struct_ref) format4 ->
'afail fmt is a struct_ref that is broken with the given capnp exception message.
val broken_cap : Exception.t -> capbroken_cap ex is a cap that is broken with the given exception.
val broken_struct : Error.t -> struct_refbroken_struct err is a struct_ref that is broken with the given error.
val resolved : Response_payload.t or_error -> struct_refresolved x is a resolved struct_ref with resolution x.
val resolve_payload : struct_resolver -> Response_payload.t or_error -> unitresolve_payload r x is r#resolve (resolved x). r takes ownership of x.
val resolve_ok : struct_resolver -> Wire.Response.t -> unitresolve_ok r msg is resolve_payload r (Ok msg). r takes ownership of msg.
val resolve_exn : struct_resolver -> Exception.t -> unitresolve_exn r exn is resolve_payload r (Error (`Exception exn)).
val when_broken : (Exception.t -> unit) -> cap -> unitwhen_broken fn x calls fn problem when x becomes broken. If x is already broken, fn is called immediately. If x can never become broken (e.g. it is a near ref), this does nothing.