package capnp

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

This module is only for use by the code generated by the capnp-ocaml schema compiler. The generated code provides type-safe wrappers for everything here.

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.

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.