capnp

OCaml code generation plugin for the Cap'n Proto serialization framework
IN THIS PACKAGE
Module Capnp . RPC . S . Untyped
type abstract_method_t

An untyped method. This will typically be something like 'a reader_t -> 'b StructRef.t. i.e. the result of calling an interface's method is a promise for the future result.

val abstract_method : ( 'a StructStorage.reader_t, 'b ) Service.method_t -> abstract_method_t

Cast a method to abstract_method_t. Typically this will be the identity function. This is used in the generated code to ensure that all methods have the same type for the dispatch function.

val struct_field : 'a StructRef.t -> int -> 'b StructRef.t

struct_field t i is a reference to the struct found at pointer index i within the struct t. Used to implement the "_pipelined" accessors.

val capability_field : 'a StructRef.t -> int -> 'b Capability.t

capability_field t i is a reference to the capability found at pointer index i within the struct t. Used to implement the "_pipelined" accessors.

class type generic_service = object ... end
val local : generic_service -> 'a Capability.t

local service is a capability reference to a local service implemented by service#dispatch. Used by the generated functions with the same name (but a fixed type).

Used in the generated code to get a capability from the attachments by index.

Used in the generated code to store a capability in the attachments. Returns the new index.

val clear_cap : MessageSig.attachments -> Uint32.t -> unit

Remove a capability from the attachments. Used if the interface is changed.

val unknown_interface : interface_id:Uint64.t -> abstract_method_t

Used to handle calls when the interface ID isn't known.

val unknown_method : interface_id:Uint64.t -> method_id:int -> abstract_method_t

Used to handle calls when the method ID isn't known.