From 04df8c2e29283f6a4af1d83618ee6f3bbda636b0 Mon Sep 17 00:00:00 2001 From: Thomas Leonard Date: Tue, 4 Feb 2025 10:27:50 +0000 Subject: [PATCH] Update capnp-rpc doc to 2.1. --- .../Capability/Request/index.html | 2 -- .../Capnp_rpc_lwt/Capability/index.html | 33 ------------------- .../class-type-persistent/index.html | 2 -- .../Capnp_rpc_lwt/Persistence/index.html | 12 ------- .../Capnp_rpc_lwt/Service/Response/index.html | 2 -- .../Capnp_rpc_lwt/Service/index.html | 14 -------- .../Capnp_rpc_lwt/StructRef/index.html | 2 -- .../Capnp_rpc_lwt/Sturdy_ref/index.html | 15 --------- capnp-rpc-lwt/Capnp_rpc_lwt/index.html | 2 -- capnp-rpc-lwt/index.html | 2 -- .../Capnp_rpc_net/Auth/Digest/index.html | 2 +- .../Capnp_rpc_net/Auth/Secret_key/index.html | 2 +- capnp-rpc-net/Capnp_rpc_net/Auth/index.html | 2 +- .../Capnp_address/Location/index.html | 2 +- .../Capnp_rpc_net/Capnp_address/index.html | 2 +- .../Capnp_rpc_net/Endpoint/index.html | 2 +- .../Capnp_rpc_net/Networking/CapTP/index.html | 2 +- .../Capnp_rpc_net/Networking/Vat/index.html | 2 +- .../argument-1-N/Address/index.html | 2 +- .../Networking/argument-1-N/Types/index.html | 2 +- .../Networking/argument-1-N/index.html | 2 +- .../Capnp_rpc_net/Networking/index.html | 2 +- .../Capnp_rpc_net/Restorer/Id/index.html | 2 +- .../Capnp_rpc_net/Restorer/Table/index.html | 4 +-- .../Capnp_rpc_net/Restorer/index.html | 2 +- .../Restorer/module-type-LOADER/index.html | 2 +- capnp-rpc-net/Capnp_rpc_net/S/index.html | 2 +- .../S/module-type-ADDRESS/index.html | 2 +- .../S/module-type-NETWORK/Address/index.html | 2 +- .../S/module-type-NETWORK/Types/index.html | 2 +- .../S/module-type-NETWORK/index.html | 2 +- .../module-type-VAT_NETWORK/CapTP/index.html | 2 +- .../Network/Address/index.html | 2 +- .../Network/Types/index.html | 2 +- .../Network/index.html | 2 +- .../S/module-type-VAT_NETWORK/Vat/index.html | 2 +- .../S/module-type-VAT_NETWORK/index.html | 2 +- .../Capnp_rpc_net/Tls_wrapper/index.html | 2 +- .../Two_party_network/Address/index.html | 2 +- .../Two_party_network/Types/index.html | 2 +- .../Two_party_network/index.html | 2 +- capnp-rpc-net/Capnp_rpc_net/index.html | 2 +- .../module-type-VAT_NETWORK/CapTP/index.html | 2 +- .../Network/Address/index.html | 2 +- .../Network/Types/index.html | 2 +- .../Network/index.html | 2 +- .../module-type-VAT_NETWORK/Vat/index.html | 2 +- .../module-type-VAT_NETWORK/index.html | 2 +- capnp-rpc-net/index.html | 2 +- .../Capnp_rpc_unix/CapTP/index.html | 2 +- .../Capnp_rpc_unix/Cap_file/index.html | 2 +- .../Capnp_rpc_unix/File_store/index.html | 2 +- .../Capnp_rpc_unix/Network/Address/index.html | 2 +- .../Network/Location/index.html | 2 +- .../Capnp_rpc_unix/Network/Types/index.html | 2 +- .../Capnp_rpc_unix/Network/index.html | 2 +- capnp-rpc-unix/Capnp_rpc_unix/Vat/index.html | 2 +- .../Capnp_rpc_unix/Vat_config/index.html | 2 +- capnp-rpc-unix/Capnp_rpc_unix/index.html | 2 +- capnp-rpc-unix/index.html | 2 +- .../Capnp_rpc/Capability/Request/index.html | 2 +- capnp-rpc/Capnp_rpc/Capability/index.html | 2 +- capnp-rpc/Capnp_rpc/Leak_handler/index.html | 2 +- capnp-rpc/Capnp_rpc/ListStorage/index.html | 2 +- capnp-rpc/Capnp_rpc/Message/index.html | 2 +- capnp-rpc/Capnp_rpc/Object/index.html | 2 +- .../class-type-persistent/index.html | 2 +- capnp-rpc/Capnp_rpc/Persistence/index.html | 2 +- capnp-rpc/Capnp_rpc/Segment/index.html | 2 +- .../Capnp_rpc/Service/Response/index.html | 2 +- capnp-rpc/Capnp_rpc/Service/index.html | 2 +- capnp-rpc/Capnp_rpc/Slice/index.html | 2 +- capnp-rpc/Capnp_rpc/Std/index.html | 2 +- capnp-rpc/Capnp_rpc/StructRef/index.html | 2 +- capnp-rpc/Capnp_rpc/StructStorage/index.html | 2 +- capnp-rpc/Capnp_rpc/Sturdy_ref/index.html | 2 +- capnp-rpc/Capnp_rpc/index.html | 2 +- .../Core_types/Attachments/index.html | 2 +- .../Core_types/Request_payload/index.html | 2 +- .../Core_types/Response_payload/index.html | 2 +- .../Core_types/Wire/Path/index.html | 2 +- .../Core_types/Wire/Request/index.html | 2 +- .../Core_types/Wire/Response/index.html | 2 +- .../argument-1-EP/Core_types/Wire/index.html | 2 +- .../Core_types/class-ref_counted/index.html | 2 +- .../Core_types/class-service/index.html | 2 +- .../Core_types/class-type-base_ref/index.html | 2 +- .../Core_types/class-type-cap/index.html | 2 +- .../class-type-struct_ref/index.html | 2 +- .../class-type-struct_resolver/index.html | 2 +- .../Make/argument-1-EP/Core_types/index.html | 2 +- .../Make/argument-1-EP/In/AnswerId/index.html | 2 +- .../Make/argument-1-EP/In/ExportId/index.html | 2 +- .../Make/argument-1-EP/In/ImportId/index.html | 2 +- .../argument-1-EP/In/QuestionId/index.html | 2 +- .../CapTP/Make/argument-1-EP/In/index.html | 2 +- .../argument-1-EP/Network_types/index.html | 2 +- .../argument-1-EP/Out/AnswerId/index.html | 2 +- .../argument-1-EP/Out/ExportId/index.html | 2 +- .../argument-1-EP/Out/ImportId/index.html | 2 +- .../argument-1-EP/Out/QuestionId/index.html | 2 +- .../CapTP/Make/argument-1-EP/Out/index.html | 2 +- .../argument-1-EP/Table/AnswerId/index.html | 2 +- .../argument-1-EP/Table/ExportId/index.html | 2 +- .../argument-1-EP/Table/ImportId/index.html | 2 +- .../argument-1-EP/Table/QuestionId/index.html | 2 +- .../CapTP/Make/argument-1-EP/Table/index.html | 2 +- .../CapTP/Make/argument-1-EP/index.html | 2 +- .../Capnp_rpc_proto/CapTP/Make/index.html | 2 +- capnp-rpc/Capnp_rpc_proto/CapTP/index.html | 2 +- .../Make/argument-1-C/Attachments/index.html | 2 +- .../argument-1-C/Request_payload/index.html | 2 +- .../argument-1-C/Response_payload/index.html | 2 +- .../Make/argument-1-C/Wire/Path/index.html | 2 +- .../Make/argument-1-C/Wire/Request/index.html | 2 +- .../argument-1-C/Wire/Response/index.html | 2 +- .../Make/argument-1-C/Wire/index.html | 2 +- .../argument-1-C/class-ref_counted/index.html | 2 +- .../argument-1-C/class-service/index.html | 2 +- .../class-type-base_ref/index.html | 2 +- .../argument-1-C/class-type-cap/index.html | 2 +- .../class-type-struct_ref/index.html | 2 +- .../class-type-struct_resolver/index.html | 2 +- .../Cap_proxy/Make/argument-1-C/index.html | 2 +- .../Make/class-type-resolver_cap/index.html | 2 +- .../Capnp_rpc_proto/Cap_proxy/Make/index.html | 2 +- .../Capnp_rpc_proto/Cap_proxy/index.html | 2 +- .../Core_types/Attachments/index.html | 2 +- .../Core_types/Request_payload/index.html | 2 +- .../Core_types/Response_payload/index.html | 2 +- .../Core_types/argument-1-W/Path/index.html | 2 +- .../argument-1-W/Request/index.html | 2 +- .../argument-1-W/Response/index.html | 2 +- .../Core_types/argument-1-W/index.html | 2 +- .../Core_types/class-ref_counted/index.html | 2 +- .../Core_types/class-service/index.html | 2 +- .../Core_types/class-type-base_ref/index.html | 2 +- .../Core_types/class-type-cap/index.html | 2 +- .../class-type-struct_ref/index.html | 2 +- .../class-type-struct_resolver/index.html | 2 +- .../Capnp_rpc_proto/Core_types/index.html | 2 +- .../Capnp_rpc_proto/Debug/OID/index.html | 2 +- capnp-rpc/Capnp_rpc_proto/Debug/index.html | 2 +- capnp-rpc/Capnp_rpc_proto/Error/index.html | 2 +- .../Capnp_rpc_proto/Exception/index.html | 2 +- capnp-rpc/Capnp_rpc_proto/Id/Make/index.html | 2 +- capnp-rpc/Capnp_rpc_proto/Id/index.html | 2 +- .../Id/module-type-S/index.html | 2 +- .../Make/argument-1-C/Attachments/index.html | 2 +- .../argument-1-C/Request_payload/index.html | 2 +- .../argument-1-C/Response_payload/index.html | 2 +- .../Make/argument-1-C/Wire/Path/index.html | 2 +- .../Make/argument-1-C/Wire/Request/index.html | 2 +- .../argument-1-C/Wire/Response/index.html | 2 +- .../Make/argument-1-C/Wire/index.html | 2 +- .../argument-1-C/class-ref_counted/index.html | 2 +- .../argument-1-C/class-service/index.html | 2 +- .../class-type-base_ref/index.html | 2 +- .../argument-1-C/class-type-cap/index.html | 2 +- .../class-type-struct_ref/index.html | 2 +- .../class-type-struct_resolver/index.html | 2 +- .../Make/argument-1-C/index.html | 2 +- .../Local_struct_promise/Make/index.html | 2 +- .../Local_struct_promise/index.html | 2 +- .../Message_types/EmbargoId/index.html | 2 +- .../Endpoint/In/AnswerId/index.html | 2 +- .../Endpoint/In/ExportId/index.html | 2 +- .../Endpoint/In/ImportId/index.html | 2 +- .../Endpoint/In/QuestionId/index.html | 2 +- .../Message_types/Endpoint/In/index.html | 2 +- .../Endpoint/Out/AnswerId/index.html | 2 +- .../Endpoint/Out/ExportId/index.html | 2 +- .../Endpoint/Out/ImportId/index.html | 2 +- .../Endpoint/Out/QuestionId/index.html | 2 +- .../Message_types/Endpoint/Out/index.html | 2 +- .../Attachments/index.html | 2 +- .../Request_payload/index.html | 2 +- .../Response_payload/index.html | 2 +- .../Wire/Path/index.html | 2 +- .../Wire/Request/index.html | 2 +- .../Wire/Response/index.html | 2 +- .../argument-1-Core_types/Wire/index.html | 2 +- .../class-ref_counted/index.html | 2 +- .../class-service/index.html | 2 +- .../class-type-base_ref/index.html | 2 +- .../class-type-cap/index.html | 2 +- .../class-type-struct_ref/index.html | 2 +- .../class-type-struct_resolver/index.html | 2 +- .../Endpoint/argument-1-Core_types/index.html | 2 +- .../argument-2-Network_types/index.html | 2 +- .../argument-3-Table/AnswerId/index.html | 2 +- .../argument-3-Table/ExportId/index.html | 2 +- .../argument-3-Table/ImportId/index.html | 2 +- .../argument-3-Table/QuestionId/index.html | 2 +- .../Endpoint/argument-3-Table/index.html | 2 +- .../Message_types/Endpoint/index.html | 2 +- .../Flip/argument-1-T/AnswerId/index.html | 2 +- .../Flip/argument-1-T/ExportId/index.html | 2 +- .../Flip/argument-1-T/ImportId/index.html | 2 +- .../Flip/argument-1-T/QuestionId/index.html | 2 +- .../Flip/argument-1-T/index.html | 2 +- .../Message_types/Flip/index.html | 2 +- .../Attachments/index.html | 2 +- .../Request_payload/index.html | 2 +- .../Response_payload/index.html | 2 +- .../Wire/Path/index.html | 2 +- .../Wire/Request/index.html | 2 +- .../Wire/Response/index.html | 2 +- .../argument-1-Core_types/Wire/index.html | 2 +- .../class-ref_counted/index.html | 2 +- .../class-service/index.html | 2 +- .../class-type-base_ref/index.html | 2 +- .../class-type-cap/index.html | 2 +- .../class-type-struct_ref/index.html | 2 +- .../class-type-struct_resolver/index.html | 2 +- .../Make/argument-1-Core_types/index.html | 2 +- .../Make/argument-2-Network/index.html | 2 +- .../Make/argument-3-T/AnswerId/index.html | 2 +- .../Make/argument-3-T/ExportId/index.html | 2 +- .../Make/argument-3-T/ImportId/index.html | 2 +- .../Make/argument-3-T/QuestionId/index.html | 2 +- .../Make/argument-3-T/index.html | 2 +- .../Message_types/Make/index.html | 2 +- .../Table_types/AnswerId/index.html | 2 +- .../Table_types/ExportId/index.html | 2 +- .../Table_types/ImportId/index.html | 2 +- .../Table_types/QuestionId/index.html | 2 +- .../Message_types/Table_types/index.html | 2 +- .../Capnp_rpc_proto/Message_types/index.html | 2 +- .../Core_types/Attachments/index.html | 2 +- .../Core_types/Request_payload/index.html | 2 +- .../Core_types/Response_payload/index.html | 2 +- .../Core_types/Wire/Path/index.html | 2 +- .../Core_types/Wire/Request/index.html | 2 +- .../Core_types/Wire/Response/index.html | 2 +- .../Core_types/Wire/index.html | 2 +- .../Core_types/class-ref_counted/index.html | 2 +- .../Core_types/class-service/index.html | 2 +- .../Core_types/class-type-base_ref/index.html | 2 +- .../Core_types/class-type-cap/index.html | 2 +- .../class-type-struct_ref/index.html | 2 +- .../class-type-struct_resolver/index.html | 2 +- .../Core_types/index.html | 2 +- .../In/AnswerId/index.html | 2 +- .../In/ExportId/index.html | 2 +- .../In/ImportId/index.html | 2 +- .../In/QuestionId/index.html | 2 +- .../module-type-ENDPOINT/In/index.html | 2 +- .../Network_types/index.html | 2 +- .../Out/AnswerId/index.html | 2 +- .../Out/ExportId/index.html | 2 +- .../Out/ImportId/index.html | 2 +- .../Out/QuestionId/index.html | 2 +- .../module-type-ENDPOINT/Out/index.html | 2 +- .../Table/AnswerId/index.html | 2 +- .../Table/ExportId/index.html | 2 +- .../Table/ImportId/index.html | 2 +- .../Table/QuestionId/index.html | 2 +- .../module-type-ENDPOINT/Table/index.html | 2 +- .../module-type-ENDPOINT/index.html | 2 +- .../AnswerId/index.html | 2 +- .../ExportId/index.html | 2 +- .../ImportId/index.html | 2 +- .../QuestionId/index.html | 2 +- .../module-type-TABLE_TYPES/index.html | 2 +- capnp-rpc/Capnp_rpc_proto/RC/index.html | 2 +- capnp-rpc/Capnp_rpc_proto/RO_array/index.html | 2 +- capnp-rpc/Capnp_rpc_proto/S/index.html | 2 +- .../Attachments/index.html | 2 +- .../Request_payload/index.html | 2 +- .../Response_payload/index.html | 2 +- .../Wire/Path/index.html | 2 +- .../Wire/Request/index.html | 2 +- .../Wire/Response/index.html | 2 +- .../S/module-type-CORE_TYPES/Wire/index.html | 2 +- .../class-ref_counted/index.html | 2 +- .../class-service/index.html | 2 +- .../class-type-base_ref/index.html | 2 +- .../class-type-cap/index.html | 2 +- .../class-type-struct_ref/index.html | 2 +- .../class-type-struct_resolver/index.html | 2 +- .../S/module-type-CORE_TYPES/index.html | 2 +- .../S/module-type-NETWORK_TYPES/index.html | 2 +- .../S/module-type-PAYLOAD/index.html | 2 +- .../S/module-type-WIRE/Path/index.html | 2 +- .../S/module-type-WIRE/Request/index.html | 2 +- .../S/module-type-WIRE/Response/index.html | 2 +- .../S/module-type-WIRE/index.html | 2 +- .../S/module-type-WIRE_PAYLOAD/index.html | 2 +- capnp-rpc/Capnp_rpc_proto/Stats/index.html | 2 +- capnp-rpc/Capnp_rpc_proto/index.html | 2 +- capnp-rpc/index.html | 2 +- index.html | 7 ++-- odoc.support/odoc.css | 2 +- 294 files changed, 287 insertions(+), 374 deletions(-) delete mode 100644 capnp-rpc-lwt/Capnp_rpc_lwt/Capability/Request/index.html delete mode 100644 capnp-rpc-lwt/Capnp_rpc_lwt/Capability/index.html delete mode 100644 capnp-rpc-lwt/Capnp_rpc_lwt/Persistence/class-type-persistent/index.html delete mode 100644 capnp-rpc-lwt/Capnp_rpc_lwt/Persistence/index.html delete mode 100644 capnp-rpc-lwt/Capnp_rpc_lwt/Service/Response/index.html delete mode 100644 capnp-rpc-lwt/Capnp_rpc_lwt/Service/index.html delete mode 100644 capnp-rpc-lwt/Capnp_rpc_lwt/StructRef/index.html delete mode 100644 capnp-rpc-lwt/Capnp_rpc_lwt/Sturdy_ref/index.html delete mode 100644 capnp-rpc-lwt/Capnp_rpc_lwt/index.html delete mode 100644 capnp-rpc-lwt/index.html diff --git a/capnp-rpc-lwt/Capnp_rpc_lwt/Capability/Request/index.html b/capnp-rpc-lwt/Capnp_rpc_lwt/Capability/Request/index.html deleted file mode 100644 index 3b860181..00000000 --- a/capnp-rpc-lwt/Capnp_rpc_lwt/Capability/Request/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Request (capnp-rpc-lwt.Capnp_rpc_lwt.Capability.Request)

Module Capability.Request

type 'a t

An 'a t is a builder for the out-going request's payload.

val create : ?message_size:int -> (Capnp.Message.rw Slice.t -> 'a) -> 'a t * 'a

create init is a fresh request payload and contents builder. Use one of the generated init_pointer functions for init.

  • parameter message_size

    An estimate of the size of the payload. If this is too small, additional segments will be allocated automatically, but this is less efficient than getting the size right to start with.

val create_no_args : unit -> 'a t

create_no_args () is a payload with no content.

val release : 'a t -> unit

Clear the exported refs, dropping their ref-counts. This is called automatically when you send a message, but you might need it if you decide to abort.

diff --git a/capnp-rpc-lwt/Capnp_rpc_lwt/Capability/index.html b/capnp-rpc-lwt/Capnp_rpc_lwt/Capability/index.html deleted file mode 100644 index ec1386d9..00000000 --- a/capnp-rpc-lwt/Capnp_rpc_lwt/Capability/index.html +++ /dev/null @@ -1,33 +0,0 @@ - -Capability (capnp-rpc-lwt.Capnp_rpc_lwt.Capability)

Module Capnp_rpc_lwt.Capability

A capability is a reference to an object, or to a promise for an object. You can invoke methods on a capability even while it is still only a promise.

type +'a t = 'a Capnp_rpc.Capability.t

An 'a t is a capability reference to a service of type 'a.

val broken : Capnp_rpc.Exception.t -> 'a t

broken ex is a broken capability, with problem ex. Any attempt to call methods on it will fail with ex.

val when_broken : (Capnp_rpc.Exception.t -> unit) -> 'a t -> unit

when_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. If x's ref-count reaches zero without fn being called, it will never be called.

val when_released : 'a t -> (unit -> unit) -> unit

when_released t fn will call fn () when t's ref-count drops to zero. This is used for caches, to remove entries when they become invalid. For promises, fn will be transferred to the resolution if resolved. For broken caps, this method does nothing (exceptions are never released).

val problem : 'a t -> Capnp_rpc.Exception.t option

problem t is Some ex if t is broken, or None if it is still believed to be healthy. Once a capability is broken, it will never work again and any calls made on it will fail with exception ex.

val await_settled : 'a t -> (unit, Capnp_rpc.Exception.t) Lwt_result.t

await_settled t resolves once t is a "settled" (non-promise) reference. If t is a near, far or broken reference, this returns immediately. If it is currently a local or remote promise, it waits until it isn't. until_settled takes ownership of t until it returns (you must not dec_ref it before then).

  • returns

    Ok () on success, or Error _ if t failed.

  • since 1.2
val await_settled_exn : 'a t -> unit Lwt.t

Like await_settled, but raises an exception on error.

  • since 1.2
val equal : 'a t -> 'a t -> (bool, [ `Unsettled ]) Stdlib.result

equal a b indicates whether a and b designate the same settled service. Returns Error `Unsettled if a or b is still a promise (and they therefore may yet turn out to be equal when the promise resolves).

module Request : sig ... end
val call : - 't t -> - ('t, 'a, 'b StructStorage.reader_t) Capnp.RPC.MethodID.t -> - 'a Request.t -> - 'b StructRef.t

call target m req invokes target#m req and returns a promise for the result. Messages may be sent to the capabilities that will be in the result before the result arrives - they will be pipelined to the service responsible for resolving the promise. The caller must call StructRef.dec_ref when finished with the result (consider using one of the call_* functions below instead for a simpler interface).

val call_and_wait : - 't t -> - ('t, 'a, 'b StructStorage.reader_t) Capnp.RPC.MethodID.t -> - 'a Request.t -> - ('b StructStorage.reader_t * (unit -> unit), - [> `Capnp of Capnp_rpc.Error.t ]) - Lwt_result.t

call_and_wait t m req does call t m req and waits for the response. This is simpler than using call, but doesn't support pipelining (you can't use any capabilities in the response in another message until the response arrives). On success, it returns Ok (response, release_response_caps). Call release_response_caps when done with the results, to release any capabilities it might contain that you didn't use (remembering that future versions of the protocol might add new optional capabilities you don't know about yet). If you don't need any capabilities from the result, consider using call_for_value instead. Doing Lwt.cancel on the result will send a cancel message to the target for remote calls.

val call_for_value : - 't t -> - ('t, 'a, 'b StructStorage.reader_t) Capnp.RPC.MethodID.t -> - 'a Request.t -> - ('b StructStorage.reader_t, [> `Capnp of Capnp_rpc.Error.t ]) Lwt_result.t

call_for_value t m req is similar to call_and_wait, but automatically releases any capabilities in the response before returning. Use this if you aren't expecting any capabilities in the response.

val call_for_value_exn : - 't t -> - ('t, 'a, 'b StructStorage.reader_t) Capnp.RPC.MethodID.t -> - 'a Request.t -> - 'b StructStorage.reader_t Lwt.t

Wrapper for call_for_value that turns errors into Lwt failures.

val call_for_unit : - 't t -> - ('t, 'a, 'b StructStorage.reader_t) Capnp.RPC.MethodID.t -> - 'a Request.t -> - (unit, [> `Capnp of Capnp_rpc.Error.t ]) Lwt_result.t

Wrapper for call_for_value that ignores the result.

val call_for_unit_exn : - 't t -> - ('t, 'a, 'b StructStorage.reader_t) Capnp.RPC.MethodID.t -> - 'a Request.t -> - unit Lwt.t

Wrapper for call_for_unit that turns errors into Lwt failures.

val call_for_caps : - 't t -> - ('t, 'a, 'b StructStorage.reader_t) Capnp.RPC.MethodID.t -> - 'a Request.t -> - ('b StructRef.t -> 'c) -> - 'c

call_for_caps target m req extract is a wrapper for call that passes the results promise to extract, which should extract any required capability promises from it. In the common case where you want a single cap "foo" from the result, use call_for_caps target m req Results.foo_get_pipelined. When the remote call finally returns, the result will be released automatically.

type 'a resolver

An 'a resolver can be used to resolve a promise for an 'a. It can only be used once.

val promise : unit -> 'a t * 'a resolver

promise () returns a fresh local promise and a resolver for it. Any calls made on the promise will be queued until it is resolved.

val resolve_ok : 'a resolver -> 'a t -> unit

resolve_ok r x resolves r's promise to x. r takes ownership of x (the caller must use inc_ref first if they want to continue using it).

val resolve_exn : 'a resolver -> Capnp_rpc.Exception.t -> unit

resolve_exn r x breaks r's promise with exception x.

val inc_ref : _ t -> unit

inc_ref t increases the ref-count on t by one.

val dec_ref : _ t -> unit

dec_ref t decreases the ref-count on t by one. When the count reaches zero, the capability is released. This may involve sending a notification to a remote peer. Any time you extract a capability from a struct or struct promise, it must eventually be freed by calling dec_ref on it.

val with_ref : 'a t -> ('a t -> 'b Lwt.t) -> 'b Lwt.t

with_ref t fn runs fn t and then calls dec_ref t (whether fn succeeds or not).

val pp : 'a t Fmt.t
diff --git a/capnp-rpc-lwt/Capnp_rpc_lwt/Persistence/class-type-persistent/index.html b/capnp-rpc-lwt/Capnp_rpc_lwt/Persistence/class-type-persistent/index.html deleted file mode 100644 index 600b3ff2..00000000 --- a/capnp-rpc-lwt/Capnp_rpc_lwt/Persistence/class-type-persistent/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -persistent (capnp-rpc-lwt.Capnp_rpc_lwt.Persistence.persistent)

Class type Persistence.persistent

method save : ('a Sturdy_ref.t, Capnp_rpc.Exception.t) Stdlib.result Lwt.t
diff --git a/capnp-rpc-lwt/Capnp_rpc_lwt/Persistence/index.html b/capnp-rpc-lwt/Capnp_rpc_lwt/Persistence/index.html deleted file mode 100644 index 0962c7bf..00000000 --- a/capnp-rpc-lwt/Capnp_rpc_lwt/Persistence/index.html +++ /dev/null @@ -1,12 +0,0 @@ - -Persistence (capnp-rpc-lwt.Capnp_rpc_lwt.Persistence)

Module Capnp_rpc_lwt.Persistence

class type 'a persistent = object ... end
val with_persistence : - 'a persistent -> - ('impl -> 'a Capability.t) -> - {Untyped}1.generic_service as 'impl -> - 'a Capability.t

with_persistence persist Service.Foo.local obj is like Service.Foo.local obj, but the resulting service also handles the Cap'n Proto persistence protocol, using persist.

val with_sturdy_ref : - 'a Sturdy_ref.t -> - ('impl -> 'a Capability.t) -> - {Untyped}1.generic_service as 'impl -> - 'a Capability.t

with_sturdy_ref sr Service.Foo.local obj is like Service.Foo.local obj, but responds to save calls by returning sr.

val save : - 'a Capability.t -> - (Uri.t, [> `Capnp of Capnp_rpc.Error.t ]) Lwt_result.t

save cap calls the persistent save method on cap. Note that not all capabilities can be saved. todo: this should return an 'a Sturdy_ref.t; see Sturdy_ref.reader.

val save_exn : 'a Capability.t -> Uri.t Lwt.t

save_exn is a wrapper for save that returns a failed thread on error.

diff --git a/capnp-rpc-lwt/Capnp_rpc_lwt/Service/Response/index.html b/capnp-rpc-lwt/Capnp_rpc_lwt/Service/Response/index.html deleted file mode 100644 index 980b73f1..00000000 --- a/capnp-rpc-lwt/Capnp_rpc_lwt/Service/Response/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Response (capnp-rpc-lwt.Capnp_rpc_lwt.Service.Response)

Module Service.Response

type 'b t

An 'a t is a builder for the out-going response.

val create : ?message_size:int -> (Capnp.Message.rw Slice.t -> 'a) -> 'a t * 'a

create init is a fresh response and contents builder. Use one of the generated init_pointer functions for init.

val create_empty : unit -> 'a t

empty () is an empty response.

val release : 'a t -> unit

Clear the exported refs, dropping their ref-counts. This is called automatically when you send a message, but you might need it if you decide to abort.

diff --git a/capnp-rpc-lwt/Capnp_rpc_lwt/Service/index.html b/capnp-rpc-lwt/Capnp_rpc_lwt/Service/index.html deleted file mode 100644 index ae6d12eb..00000000 --- a/capnp-rpc-lwt/Capnp_rpc_lwt/Service/index.html +++ /dev/null @@ -1,14 +0,0 @@ - -Service (capnp-rpc-lwt.Capnp_rpc_lwt.Service)

Module Capnp_rpc_lwt.Service

Functions for service implementors.

type ('a, 'b) method_t = 'a -> (unit -> unit) -> 'b StructRef.t

An ('a, 'b) method_t is a method implementation that takes a reader for the parameters and a function to release the capabilities in the parameters, and returns a promise for the results.

module Response : sig ... end
val return : 'a Response.t -> 'a StructRef.t

return r wraps up a simple local result as a promise.

val return_empty : unit -> 'a StructRef.t

return_empty () is a promise for a response with no payload.

val return_lwt : - (unit -> ('a Response.t, [< `Capnp of Capnp_rpc.Error.t ]) Lwt_result.t) -> - 'a StructRef.t

return_lwt fn is a local promise for the result of Lwt thread fn (). If fn () fails, the error is logged and an "Internal error" returned to the caller. If it returns an Error value then that error is returned to the caller. Note that this does not support pipelining (any messages sent to the response will be queued locally until it fn has produced a result), so it may be better to return immediately a result containing a promise in some cases.

val fail : - ?ty:Capnp_rpc.Exception.ty -> - ('a, Stdlib.Format.formatter, unit, 'b StructRef.t) Stdlib.format4 -> - 'a

fail msg is an exception with reason msg.

val fail_lwt : - ?ty:Capnp_rpc.Exception.ty -> - ('a, - Stdlib.Format.formatter, - unit, - (_, [> `Capnp of Capnp_rpc.Error.t ]) Lwt_result.t) - Stdlib.format4 -> - 'a

fail_lwt msg is like fail msg, but can be used with return_lwt.

diff --git a/capnp-rpc-lwt/Capnp_rpc_lwt/StructRef/index.html b/capnp-rpc-lwt/Capnp_rpc_lwt/StructRef/index.html deleted file mode 100644 index 7460ba20..00000000 --- a/capnp-rpc-lwt/Capnp_rpc_lwt/StructRef/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -StructRef (capnp-rpc-lwt.Capnp_rpc_lwt.StructRef)

Module Capnp_rpc_lwt.StructRef

A promise for a response structure. You can use the generated _get_pipelined functions on a promise to get a promise for a capability inside the promise, and then pipeline messages to that promise without waiting for the response struct to arrive.

type 'a t = 'a Capnp_rpc.StructRef.t

An 'a t is a reference to a response message (that may not have arrived yet) with content type 'a.

val inc_ref : 'a t -> unit

inc_ref t increases the reference count on t by one.

val dec_ref : 'a t -> unit

dec_ref t reduces the reference count on t by one. When the count reaches zero, this result must never be used again. If the results have not yet arrived when the count reaches zero, we send a cancellation request (which may or may not succeed). As soon as the results are available, they are released.

diff --git a/capnp-rpc-lwt/Capnp_rpc_lwt/Sturdy_ref/index.html b/capnp-rpc-lwt/Capnp_rpc_lwt/Sturdy_ref/index.html deleted file mode 100644 index dacc6f08..00000000 --- a/capnp-rpc-lwt/Capnp_rpc_lwt/Sturdy_ref/index.html +++ /dev/null @@ -1,15 +0,0 @@ - -Sturdy_ref (capnp-rpc-lwt.Capnp_rpc_lwt.Sturdy_ref)

Module Capnp_rpc_lwt.Sturdy_ref

type +'a t = 'a Capnp_rpc.Sturdy_ref.t

An off-line (persistent) capability reference.

A sturdy ref contains all the information necessary to get a live reference to a service:

  • The network address of the hosting vat (e.g. TCP host and port)
  • A way to authenticate the hosting vat (e.g. a fingerprint of the vat's public key)
  • A way to identify the target service within the vat and prove permission to access it (e.g. a "Swiss number")
val connect : - 'a t -> - ('a Capability.t, Capnp_rpc.Exception.t) Stdlib.result Lwt.t

connect t returns a live reference to t's service.

val connect_exn : 'a t -> 'a Capability.t Lwt.t

connect_exn is a wrapper for connect that returns a failed Lwt thread on error.

val with_cap : - 'a t -> - ('a Capability.t -> - ('b, [> `Capnp of Capnp_rpc.Exception.t ] as 'e) Lwt_result.t) -> - ('b, 'e) Lwt_result.t

with_cap t f uses connect t to get a live-ref x, then does Capability.with_ref x f.

val with_cap_exn : 'a t -> ('a Capability.t -> 'b Lwt.t) -> 'b Lwt.t

with_cap_exn t f uses connect_exn t to get a live-ref x, then does Capability.with_ref x f.

val reader : - ('a StructStorage.reader_t -> Capnp.MessageSig.ro Slice.t option) -> - 'a StructStorage.reader_t -> - Uri.t

reader accessor is a field accessor for reading a sturdy ref. e.g. if sr_get is a generated field accessor for an AnyPointer field, then reader Reader.Struct.sr_get is an accessor that treats it as a SturdyRef field. todo: This should really return a sturdy ref, not a URI, but that requires a change to the spec to add a sturdy ref cap-descriptor table entry type.

val builder : - ('a StructStorage.builder_t -> Capnp.MessageSig.rw Slice.t) -> - 'a StructStorage.builder_t -> - _ t -> - unit

builder setter converts a generated AnyPointer field setter setter to a SturdyRef setter. Use it to add a SturdyRef to a message with builder Params.sr_get params sr.

val cast : 'a t -> 'b t
diff --git a/capnp-rpc-lwt/Capnp_rpc_lwt/index.html b/capnp-rpc-lwt/Capnp_rpc_lwt/index.html deleted file mode 100644 index 4874e850..00000000 --- a/capnp-rpc-lwt/Capnp_rpc_lwt/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Capnp_rpc_lwt (capnp-rpc-lwt.Capnp_rpc_lwt)

Module Capnp_rpc_lwt

Lwt compatibility wrappers.

This module wraps Capnp_rpc to provide the old Lwt API, to make upgrading easier. See https://github.com/mirage/capnp-rpc/blob/master/CHANGES.md for migration instructions.

module Segment = Capnp_rpc.Segment
module Message = Capnp_rpc.Message
module Slice = Capnp_rpc.Slice
module StructStorage = Capnp_rpc.StructStorage
module ListStorage = Capnp_rpc.ListStorage
module Object = Capnp_rpc.Object
module StructRef : sig ... end

A promise for a response structure. You can use the generated _get_pipelined functions on a promise to get a promise for a capability inside the promise, and then pipeline messages to that promise without waiting for the response struct to arrive.

module Capability : sig ... end

A capability is a reference to an object, or to a promise for an object. You can invoke methods on a capability even while it is still only a promise.

module Sturdy_ref : sig ... end
module Service : sig ... end

Functions for service implementors.

module Persistence : sig ... end
diff --git a/capnp-rpc-lwt/index.html b/capnp-rpc-lwt/index.html deleted file mode 100644 index 06b9722c..00000000 --- a/capnp-rpc-lwt/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -index (capnp-rpc-lwt.index)

capnp-rpc-lwt index

Library capnp-rpc-lwt

The entry point of this library is the module: Capnp_rpc_lwt.

diff --git a/capnp-rpc-net/Capnp_rpc_net/Auth/Digest/index.html b/capnp-rpc-net/Capnp_rpc_net/Auth/Digest/index.html index 280283af..d31acf2a 100644 --- a/capnp-rpc-net/Capnp_rpc_net/Auth/Digest/index.html +++ b/capnp-rpc-net/Capnp_rpc_net/Auth/Digest/index.html @@ -1,2 +1,2 @@ -Digest (capnp-rpc-net.Capnp_rpc_net.Auth.Digest)

Module Auth.Digest

type t

The digest of a public key, used to recognise a vat. This appears in URIs as e.g. 'capnp://sha256:1234@host/'.

val insecure : t

A special value indicating no authentication should be performed.

val from_uri : Uri.t -> (t, [> `Msg of string ]) Stdlib.result

from_uri t is the parsed digest information in t.

val add_to_uri : t -> Uri.t -> Uri.t

add_to_uri t uri is uri with the user and password fields set to the correct values for t. Note that although we use the "password" field, this is not secret.

val authenticator : t -> X509.Authenticator.t option

authenticator t is an authenticator that checks that the peer's public key matches t. Returns None if t is insecure. Note: it currently also requires the DN field to be "capnp".

val of_certificate : X509.Certificate.t -> t

of_certificate cert is a digest of cert's public key.

val equal : t -> t -> bool
val pp : t Fmt.t
module Map : Stdlib.Map.S with type key = t
+Digest (capnp-rpc-net.Capnp_rpc_net.Auth.Digest)

Module Auth.Digest

type t

The digest of a public key, used to recognise a vat. This appears in URIs as e.g. 'capnp://sha256:1234@host/'.

val insecure : t

A special value indicating no authentication should be performed.

val from_uri : Uri.t -> (t, [> `Msg of string ]) Stdlib.result

from_uri t is the parsed digest information in t.

val add_to_uri : t -> Uri.t -> Uri.t

add_to_uri t uri is uri with the user and password fields set to the correct values for t. Note that although we use the "password" field, this is not secret.

val authenticator : t -> X509.Authenticator.t option

authenticator t is an authenticator that checks that the peer's public key matches t. Returns None if t is insecure. Note: it currently also requires the DN field to be "capnp".

val of_certificate : X509.Certificate.t -> t

of_certificate cert is a digest of cert's public key.

val equal : t -> t -> bool
val pp : t Fmt.t
module Map : Stdlib.Map.S with type key = t
diff --git a/capnp-rpc-net/Capnp_rpc_net/Auth/Secret_key/index.html b/capnp-rpc-net/Capnp_rpc_net/Auth/Secret_key/index.html index b73a3dc7..45c85470 100644 --- a/capnp-rpc-net/Capnp_rpc_net/Auth/Secret_key/index.html +++ b/capnp-rpc-net/Capnp_rpc_net/Auth/Secret_key/index.html @@ -1,5 +1,5 @@ -Secret_key (capnp-rpc-net.Capnp_rpc_net.Auth.Secret_key)

Module Auth.Secret_key

type t

A vat's secret_key allows it to prove its identity to other vats.

val generate : unit -> t

generate () is a fresh secret key. You must use e.g. Mirage_crypto_rng_eio.run to set a source of randomness before using this (it will raise an error if you forget).

val digest : ?hash:hash -> t -> Digest.t

digest ~hash t is the digest of t's public key, using hash.

val of_pem_data : string -> t

of_pem_data data parses data as a PEM-encoded private key.

val to_pem_data : t -> string

to_pem_data t returns t as a PEM-encoded private key.

val tls_client_config : +Secret_key (capnp-rpc-net.Capnp_rpc_net.Auth.Secret_key)

Module Auth.Secret_key

type t

A vat's secret_key allows it to prove its identity to other vats.

val generate : unit -> t

generate () is a fresh secret key. You must use e.g. Mirage_crypto_rng_eio.run to set a source of randomness before using this (it will raise an error if you forget).

val digest : ?hash:hash -> t -> Digest.t

digest ~hash t is the digest of t's public key, using hash.

val of_pem_data : string -> t

of_pem_data data parses data as a PEM-encoded private key.

val to_pem_data : t -> string

to_pem_data t returns t as a PEM-encoded private key.

val tls_client_config : t -> authenticator:X509.Authenticator.t -> Tls.Config.client

tls_client_config t ~authenticator is the TLS client configuration to use for a vat with secret key t, attempting to connect to a vat that can be authenticated with authenticator.

val tls_server_config : t -> Tls.Config.server

tls_server_config t is the TLS server configuration to use for a vat with secret key t.

val pp_fingerprint : hash -> t Fmt.t

pp_fingerprint hash formats the hash of t's public key.

val equal : t -> t -> bool
diff --git a/capnp-rpc-net/Capnp_rpc_net/Auth/index.html b/capnp-rpc-net/Capnp_rpc_net/Auth/index.html index 12a7704c..3b68defe 100644 --- a/capnp-rpc-net/Capnp_rpc_net/Auth/index.html +++ b/capnp-rpc-net/Capnp_rpc_net/Auth/index.html @@ -1,2 +1,2 @@ -Auth (capnp-rpc-net.Capnp_rpc_net.Auth)

Module Capnp_rpc_net.Auth

Vat-level authentication and encryption.

Unless your network provides a secure mechanism for establishing connections to other vats, where you can be sure of the identity of the other party, you'll probably want to enable cryptographic security.

Each vat (application instance) should generate a secret key when it is first deployed. For servers at least, this key must be saved to disk so that the server retains its identity over re-starts. Otherwise, clients will think it is an imposter and refuse to connect.

Clients that do not accept incoming connections, nor create SturdyRefs, can get away with creating a new key each time. However, it might be quicker to save and reload the key anyway.

type hash = [
  1. | `SHA256
]

Supported hashes.

module Digest : sig ... end
module Secret_key : sig ... end
+Auth (capnp-rpc-net.Capnp_rpc_net.Auth)

Module Capnp_rpc_net.Auth

Vat-level authentication and encryption.

Unless your network provides a secure mechanism for establishing connections to other vats, where you can be sure of the identity of the other party, you'll probably want to enable cryptographic security.

Each vat (application instance) should generate a secret key when it is first deployed. For servers at least, this key must be saved to disk so that the server retains its identity over re-starts. Otherwise, clients will think it is an imposter and refuse to connect.

Clients that do not accept incoming connections, nor create SturdyRefs, can get away with creating a new key each time. However, it might be quicker to save and reload the key anyway.

type hash = [
  1. | `SHA256
]

Supported hashes.

module Digest : sig ... end
module Secret_key : sig ... end
diff --git a/capnp-rpc-net/Capnp_rpc_net/Capnp_address/Location/index.html b/capnp-rpc-net/Capnp_rpc_net/Capnp_address/Location/index.html index d92956c6..5d6abf91 100644 --- a/capnp-rpc-net/Capnp_rpc_net/Capnp_address/Location/index.html +++ b/capnp-rpc-net/Capnp_rpc_net/Capnp_address/Location/index.html @@ -1,2 +1,2 @@ -Location (capnp-rpc-net.Capnp_rpc_net.Capnp_address.Location)

Module Capnp_address.Location

type t = [
  1. | `Unix of string
  2. | `TCP of string * int
]
val pp : t Fmt.t
val equal : t -> t -> bool
+Location (capnp-rpc-net.Capnp_rpc_net.Capnp_address.Location)

Module Capnp_address.Location

type t = [
  1. | `Unix of string
  2. | `TCP of string * int
]
val pp : t Fmt.t
val equal : t -> t -> bool
diff --git a/capnp-rpc-net/Capnp_rpc_net/Capnp_address/index.html b/capnp-rpc-net/Capnp_rpc_net/Capnp_address/index.html index cbf9a856..4c99677f 100644 --- a/capnp-rpc-net/Capnp_rpc_net/Capnp_address/index.html +++ b/capnp-rpc-net/Capnp_rpc_net/Capnp_address/index.html @@ -1,2 +1,2 @@ -Capnp_address (capnp-rpc-net.Capnp_rpc_net.Capnp_address)

Module Capnp_rpc_net.Capnp_address

Handling of capnp:// URI format addresses. This code is shared between the unix and mirage networks.

module Location : sig ... end
include S.ADDRESS with type t = Location.t * Auth.Digest.t

A network address at which a vat can be reached.

val parse_uri : Uri.t -> (t * string, [> `Msg of string ]) Stdlib.result

parse_uri uri extracts from a URI the network address and service ID.

val to_uri : (t * string) -> Uri.t

to_uri (t, service_id) is a URI that can be parsed back into (t, service_id) by parse_uri.

val equal : t -> t -> bool
val digest : t -> Auth.Digest.t

How to verify that the correct address has been reached.

val pp : t Fmt.t
+Capnp_address (capnp-rpc-net.Capnp_rpc_net.Capnp_address)

Module Capnp_rpc_net.Capnp_address

Handling of capnp:// URI format addresses. This code is shared between the unix and mirage networks.

module Location : sig ... end
include S.ADDRESS with type t = Location.t * Auth.Digest.t

A network address at which a vat can be reached.

val parse_uri : Uri.t -> (t * string, [> `Msg of string ]) Stdlib.result

parse_uri uri extracts from a URI the network address and service ID.

val to_uri : (t * string) -> Uri.t

to_uri (t, service_id) is a URI that can be parsed back into (t, service_id) by parse_uri.

val equal : t -> t -> bool
val digest : t -> Auth.Digest.t

How to verify that the correct address has been reached.

val pp : t Fmt.t
diff --git a/capnp-rpc-net/Capnp_rpc_net/Endpoint/index.html b/capnp-rpc-net/Capnp_rpc_net/Endpoint/index.html index ac98d2ac..b19e453b 100644 --- a/capnp-rpc-net/Capnp_rpc_net/Endpoint/index.html +++ b/capnp-rpc-net/Capnp_rpc_net/Endpoint/index.html @@ -1,5 +1,5 @@ -Endpoint (capnp-rpc-net.Capnp_rpc_net.Endpoint)

Module Capnp_rpc_net.Endpoint

Send and receive capnp messages over a byte-stream.

val src : Logs.src

Control the log level.

type t

A wrapper for a byte-stream (flow).

val send : t -> 'a Capnp.BytesMessage.Message.t -> unit

send t msg enqueues msg.

val run_writer : tags:Logs.Tag.set -> t -> unit

run_writer ~tags t runs a loop that transmits batches of messages from t. It returns when the flow is closed.

val recv : +Endpoint (capnp-rpc-net.Capnp_rpc_net.Endpoint)

Module Capnp_rpc_net.Endpoint

Send and receive capnp messages over a byte-stream.

val src : Logs.src

Control the log level.

type t

A wrapper for a byte-stream (flow).

val send : t -> 'a Capnp.BytesMessage.Message.t -> unit

send t msg enqueues msg.

val run_writer : tags:Logs.Tag.set -> t -> unit

run_writer ~tags t runs a loop that transmits batches of messages from t. It returns when the flow is closed.

val recv : tags:Logs.Tag.set -> t -> (Capnp.Message.ro Capnp.BytesMessage.Message.t, [> `Closed ]) Stdlib.result

recv ~tags t reads the next message from the remote peer. It returns Error `Closed if the connection to the peer is lost.

val of_flow : peer_id:Auth.Digest.t -> _ Eio.Flow.two_way -> t

of_flow ~peer_id flow sends and receives on flow.

val peer_id : t -> Auth.Digest.t

peer_id t is the fingerprint of the peer's public key, or Auth.Digest.insecure if TLS isn't being used.

val shutdown_send : t -> unit

shutdown_send t closes the writer, causing run_writer to return once all buffered data has been written.

val disconnect : t -> unit

disconnect t shuts down the underlying flow.

diff --git a/capnp-rpc-net/Capnp_rpc_net/Networking/CapTP/index.html b/capnp-rpc-net/Capnp_rpc_net/Networking/CapTP/index.html index bbf3f688..4b2725cc 100644 --- a/capnp-rpc-net/Capnp_rpc_net/Networking/CapTP/index.html +++ b/capnp-rpc-net/Capnp_rpc_net/Networking/CapTP/index.html @@ -1,5 +1,5 @@ -CapTP (capnp-rpc-net.Capnp_rpc_net.Networking.CapTP)

Module Networking.CapTP

Sharing capabilities over a network link.

type t

A CapTP connection to a remote peer.

val connect : +CapTP (capnp-rpc-net.Capnp_rpc_net.Networking.CapTP)

Module Networking.CapTP

Sharing capabilities over a network link.

type t

A CapTP connection to a remote peer.

val connect : sw:Eio.Switch.t -> restore:Restorer.t -> ?tags:Logs.Tag.set -> diff --git a/capnp-rpc-net/Capnp_rpc_net/Networking/Vat/index.html b/capnp-rpc-net/Capnp_rpc_net/Networking/Vat/index.html index 563d33c6..5fb1d806 100644 --- a/capnp-rpc-net/Capnp_rpc_net/Networking/Vat/index.html +++ b/capnp-rpc-net/Capnp_rpc_net/Networking/Vat/index.html @@ -1,5 +1,5 @@ -Vat (capnp-rpc-net.Capnp_rpc_net.Networking.Vat)

Module Networking.Vat

A Vat is an actor in the CapTP network, composed of objects that can call each other directly.

An actor in the CapTP network. A Vat may be connected to other Vats over CapTP network connections. Typically an application will create only a single Vat. See the Capnp_rpc_unix module for a higher-level API.

type t

A local Vat.

val create : +Vat (capnp-rpc-net.Capnp_rpc_net.Networking.Vat)

Module Networking.Vat

A Vat is an actor in the CapTP network, composed of objects that can call each other directly.

An actor in the CapTP network. A Vat may be connected to other Vats over CapTP network connections. Typically an application will create only a single Vat. See the Capnp_rpc_unix module for a higher-level API.

type t

A local Vat.

val create : ?tags:Logs.Tag.set -> ?restore:Restorer.t -> ?address:Network.Address.t -> diff --git a/capnp-rpc-net/Capnp_rpc_net/Networking/argument-1-N/Address/index.html b/capnp-rpc-net/Capnp_rpc_net/Networking/argument-1-N/Address/index.html index a822f4e3..78f828d6 100644 --- a/capnp-rpc-net/Capnp_rpc_net/Networking/argument-1-N/Address/index.html +++ b/capnp-rpc-net/Capnp_rpc_net/Networking/argument-1-N/Address/index.html @@ -1,2 +1,2 @@ -Address (capnp-rpc-net.Capnp_rpc_net.Networking.N.Address)

Module N.Address

type t

A network address at which a vat can be reached.

val parse_uri : Uri.t -> (t * string, [> `Msg of string ]) Stdlib.result

parse_uri uri extracts from a URI the network address and service ID.

val to_uri : (t * string) -> Uri.t

to_uri (t, service_id) is a URI that can be parsed back into (t, service_id) by parse_uri.

val equal : t -> t -> bool
val digest : t -> Auth.Digest.t

How to verify that the correct address has been reached.

val pp : t Fmt.t
+Address (capnp-rpc-net.Capnp_rpc_net.Networking.N.Address)

Module N.Address

type t

A network address at which a vat can be reached.

val parse_uri : Uri.t -> (t * string, [> `Msg of string ]) Stdlib.result

parse_uri uri extracts from a URI the network address and service ID.

val to_uri : (t * string) -> Uri.t

to_uri (t, service_id) is a URI that can be parsed back into (t, service_id) by parse_uri.

val equal : t -> t -> bool
val digest : t -> Auth.Digest.t

How to verify that the correct address has been reached.

val pp : t Fmt.t
diff --git a/capnp-rpc-net/Capnp_rpc_net/Networking/argument-1-N/Types/index.html b/capnp-rpc-net/Capnp_rpc_net/Networking/argument-1-N/Types/index.html index dd37f307..3517038f 100644 --- a/capnp-rpc-net/Capnp_rpc_net/Networking/argument-1-N/Types/index.html +++ b/capnp-rpc-net/Capnp_rpc_net/Networking/argument-1-N/Types/index.html @@ -1,2 +1,2 @@ -Types (capnp-rpc-net.Capnp_rpc_net.Networking.N.Types)

Module N.Types

type provision_id
type recipient_id
type third_party_cap_id
type join_key_part
+Types (capnp-rpc-net.Capnp_rpc_net.Networking.N.Types)

Module N.Types

type provision_id
type recipient_id
type third_party_cap_id
type join_key_part
diff --git a/capnp-rpc-net/Capnp_rpc_net/Networking/argument-1-N/index.html b/capnp-rpc-net/Capnp_rpc_net/Networking/argument-1-N/index.html index e1fa6609..95a69401 100644 --- a/capnp-rpc-net/Capnp_rpc_net/Networking/argument-1-N/index.html +++ b/capnp-rpc-net/Capnp_rpc_net/Networking/argument-1-N/index.html @@ -1,5 +1,5 @@ -N (capnp-rpc-net.Capnp_rpc_net.Networking.N)

Parameter Networking.N

type t
val connect : +N (capnp-rpc-net.Capnp_rpc_net.Networking.N)

Parameter Networking.N

type t
val connect : t -> sw:Eio.Switch.t -> secret_key:Auth.Secret_key.t Stdlib.Lazy.t -> diff --git a/capnp-rpc-net/Capnp_rpc_net/Networking/index.html b/capnp-rpc-net/Capnp_rpc_net/Networking/index.html index 3fd06bb9..c018f93f 100644 --- a/capnp-rpc-net/Capnp_rpc_net/Networking/index.html +++ b/capnp-rpc-net/Capnp_rpc_net/Networking/index.html @@ -1,2 +1,2 @@ -Networking (capnp-rpc-net.Capnp_rpc_net.Networking)

Module Capnp_rpc_net.Networking

Stretching capability references across a network link. Note: see Capnp_rpc_unix for a higher-level wrapper for this API.

Parameters

module N : S.NETWORK

Signature

module Network = N
module CapTP : sig ... end

Sharing capabilities over a network link.

module Vat : sig ... end

A Vat is an actor in the CapTP network, composed of objects that can call each other directly.

+Networking (capnp-rpc-net.Capnp_rpc_net.Networking)

Module Capnp_rpc_net.Networking

Stretching capability references across a network link. Note: see Capnp_rpc_unix for a higher-level wrapper for this API.

Parameters

module N : S.NETWORK

Signature

module Network = N
module CapTP : sig ... end

Sharing capabilities over a network link.

module Vat : sig ... end

A Vat is an actor in the CapTP network, composed of objects that can call each other directly.

diff --git a/capnp-rpc-net/Capnp_rpc_net/Restorer/Id/index.html b/capnp-rpc-net/Capnp_rpc_net/Restorer/Id/index.html index c3dd28b8..0d8d2478 100644 --- a/capnp-rpc-net/Capnp_rpc_net/Restorer/Id/index.html +++ b/capnp-rpc-net/Capnp_rpc_net/Restorer/Id/index.html @@ -1,2 +1,2 @@ -Id (capnp-rpc-net.Capnp_rpc_net.Restorer.Id)

Module Restorer.Id

type t

The object ID passed in the Cap'n Proto Bootstrap message.

val generate : unit -> t

generate () is a fresh unguessable service ID. Note: you must initialise `Nocrypto`'s entropy before calling this (you will get a runtime error if you forget).

val derived : secret:string -> string -> t

derived ~secret name is a service ID based on secret and name. It is calculated as SHA256.hmac secret name. secret could be the hash of a private key file, for example.

val public : string -> t

public name is the service ID name. This may be useful for interoperability with non-secure clients that expect to use a plain-text service ID (e.g. "calculator"). It could also be useful if name is some unguessable token you have generated yourself.

val digest : Auth.hash -> t -> string

digest h id is the digest h id.

Since id is normally a secret token, we must be careful not to allow timing attacks (taking a slightly different amount of time to return an error depending on how much of the ID the caller guessed correctly). Taking a secure hash of the value first is one way to avoid this, since revealing the hash isn't helpful to the attacker.

val to_string : t -> string

to_string t is the raw bytes of t.

val pp : t Fmt.t
val equal : t -> t -> bool
+Id (capnp-rpc-net.Capnp_rpc_net.Restorer.Id)

Module Restorer.Id

type t

The object ID passed in the Cap'n Proto Bootstrap message.

val generate : unit -> t

generate () is a fresh unguessable service ID. Note: you must initialise `Nocrypto`'s entropy before calling this (you will get a runtime error if you forget).

val derived : secret:string -> string -> t

derived ~secret name is a service ID based on secret and name. It is calculated as SHA256.hmac secret name. secret could be the hash of a private key file, for example.

val public : string -> t

public name is the service ID name. This may be useful for interoperability with non-secure clients that expect to use a plain-text service ID (e.g. "calculator"). It could also be useful if name is some unguessable token you have generated yourself.

val digest : Auth.hash -> t -> string

digest h id is the digest h id.

Since id is normally a secret token, we must be careful not to allow timing attacks (taking a slightly different amount of time to return an error depending on how much of the ID the caller guessed correctly). Taking a secure hash of the value first is one way to avoid this, since revealing the hash isn't helpful to the attacker.

val to_string : t -> string

to_string t is the raw bytes of t.

val pp : t Fmt.t
val equal : t -> t -> bool
diff --git a/capnp-rpc-net/Capnp_rpc_net/Restorer/Table/index.html b/capnp-rpc-net/Capnp_rpc_net/Restorer/Table/index.html index 831ccee0..b4868b42 100644 --- a/capnp-rpc-net/Capnp_rpc_net/Restorer/Table/index.html +++ b/capnp-rpc-net/Capnp_rpc_net/Restorer/Table/index.html @@ -1,6 +1,6 @@ -Table (capnp-rpc-net.Capnp_rpc_net.Restorer.Table)

Module Restorer.Table

type t

A restorer that keeps a hashtable mapping IDs to capabilities in memory.

val create : (Id.t -> Uri.t) -> t

create make_sturdy is a new in-memory-only table. make_sturdy id converts an ID to a full URI, by adding the hosting vat's address and fingerprint.

val of_loader : +Table (capnp-rpc-net.Capnp_rpc_net.Restorer.Table)

Module Restorer.Table

type t

A restorer that keeps a hashtable mapping IDs to capabilities in memory.

val create : sw:Eio.Switch.t -> (Id.t -> Uri.t) -> t

create ~sw make_sturdy is a new in-memory-only table. make_sturdy id converts an ID to a full URI, by adding the hosting vat's address and fingerprint.

  • parameter sw

    clear is called when sw is turned off.

val of_loader : sw:Eio.Switch.t -> (module LOADER with type t = 'loader) -> 'loader -> - t

of_loader ~sw (module Loader) l is a new caching table that uses Loader.load l sr (Loader.hash id) to restore services that aren't in the cache. The load function runs in a new fiber in sw.

val add : t -> Id.t -> 'a Capnp_rpc.Std.Capability.t -> unit

add t id cap adds a mapping to t. It takes ownership of cap (it will call Capability.dec_ref cap on clear).

val sturdy_ref : t -> Id.t -> 'a Capnp_rpc.Std.Sturdy_ref.t

sturdy_ref t id is a sturdy ref that can be used to restore service id.

val remove : t -> Id.t -> unit

remove t id removes id from t. It decrements the capability's ref count if it was added manually with add.

val clear : t -> unit

clear t removes all entries from the table.

+ t

of_loader ~sw (module Loader) l is a new caching table that uses Loader.load l sr (Loader.hash id) to restore services that aren't in the cache.

  • parameter sw

    The load function runs in a new fiber in sw. clear is called when sw is turned off.

val add : t -> Id.t -> 'a Capnp_rpc.Std.Capability.t -> unit

add t id cap adds a mapping to t. It takes ownership of cap (it will call Capability.dec_ref cap on clear).

val sturdy_ref : t -> Id.t -> 'a Capnp_rpc.Std.Sturdy_ref.t

sturdy_ref t id is a sturdy ref that can be used to restore service id.

val remove : t -> Id.t -> unit

remove t id removes id from t. It decrements the capability's ref count if it was added manually with add.

val clear : t -> unit

clear t removes all entries from the table.

diff --git a/capnp-rpc-net/Capnp_rpc_net/Restorer/index.html b/capnp-rpc-net/Capnp_rpc_net/Restorer/index.html index e2b1e11f..98edb30c 100644 --- a/capnp-rpc-net/Capnp_rpc_net/Restorer/index.html +++ b/capnp-rpc-net/Capnp_rpc_net/Restorer/index.html @@ -1,5 +1,5 @@ -Restorer (capnp-rpc-net.Capnp_rpc_net.Restorer)

Module Capnp_rpc_net.Restorer

module Id : sig ... end

Resolutions

type resolution

Internally, this is just ('a Capability.t, Capnp_rpc.Exception.t) result but the types work out better having it abstract.

grant x is Ok x.

reject x is Error x.

val unknown_service_id : resolution

unknown_service_id is a standard rejection message.

Restorers

type t

A restorer looks up live capabilities from service IDs.

val none : t

none is a restorer that rejects everything.

val single : Id.t -> 'a Capnp_rpc.Std.Capability.t -> t

single id cap is a restorer that responds to id with cap and rejects everything else.

module type LOADER = sig ... end
module Table : sig ... end
val of_table : Table.t -> t
val restore : +Restorer (capnp-rpc-net.Capnp_rpc_net.Restorer)

Module Capnp_rpc_net.Restorer

module Id : sig ... end

Resolutions

type resolution

Internally, this is just ('a Capability.t, Capnp_rpc.Exception.t) result but the types work out better having it abstract.

grant x is Ok x.

reject x is Error x.

val unknown_service_id : resolution

unknown_service_id is a standard rejection message.

Restorers

type t

A restorer looks up live capabilities from service IDs.

val none : t

none is a restorer that rejects everything.

val single : Id.t -> 'a Capnp_rpc.Std.Capability.t -> t

single id cap is a restorer that responds to id with cap and rejects everything else.

module type LOADER = sig ... end
module Table : sig ... end
val of_table : Table.t -> t
val restore : t -> Id.t -> ('a Capnp_rpc.Std.Capability.t, Capnp_rpc.Exception.t) Stdlib.result

restore t id restores id using t. You don't normally need to call this directly, as the Vat will do it automatically.

diff --git a/capnp-rpc-net/Capnp_rpc_net/Restorer/module-type-LOADER/index.html b/capnp-rpc-net/Capnp_rpc_net/Restorer/module-type-LOADER/index.html index bed07e83..75d1666e 100644 --- a/capnp-rpc-net/Capnp_rpc_net/Restorer/module-type-LOADER/index.html +++ b/capnp-rpc-net/Capnp_rpc_net/Restorer/module-type-LOADER/index.html @@ -1,2 +1,2 @@ -LOADER (capnp-rpc-net.Capnp_rpc_net.Restorer.LOADER)

Module type Restorer.LOADER

type t

A user-provided function to restore services from persistent storage.

val hash : t -> Auth.hash

hash t is the hash to apply to a Restorer.Id.t to get the storage key, which is passed to load. You should use the hash id value to find the item. Note that hash is purely a local security measure - remote peers only see the ID.

val make_sturdy : t -> Id.t -> Uri.t

make_sturdy t id converts an ID to a full URI, by adding the hosting vat's address and fingerprint.

val load : t -> 'a Capnp_rpc.Std.Sturdy_ref.t -> string -> resolution

load t sr digest is called to restore the service with key digest. sr is a sturdy ref that refers to the service, which the service might want to hand out to clients. Note that connecting to sr will block until the loader has returned. The result is cached until its ref-count reaches zero, so the table will never allow two live capabilities for a single Id.t at once. It will also not call load twice in parallel for the same digest.

+LOADER (capnp-rpc-net.Capnp_rpc_net.Restorer.LOADER)

Module type Restorer.LOADER

type t

A user-provided function to restore services from persistent storage.

val hash : t -> Auth.hash

hash t is the hash to apply to a Restorer.Id.t to get the storage key, which is passed to load. You should use the hash id value to find the item. Note that hash is purely a local security measure - remote peers only see the ID.

val make_sturdy : t -> Id.t -> Uri.t

make_sturdy t id converts an ID to a full URI, by adding the hosting vat's address and fingerprint.

val load : t -> 'a Capnp_rpc.Std.Sturdy_ref.t -> string -> resolution

load t sr digest is called to restore the service with key digest. sr is a sturdy ref that refers to the service, which the service might want to hand out to clients. Note that connecting to sr will block until the loader has returned. The result is cached until its ref-count reaches zero, so the table will never allow two live capabilities for a single Id.t at once. It will also not call load twice in parallel for the same digest.

diff --git a/capnp-rpc-net/Capnp_rpc_net/S/index.html b/capnp-rpc-net/Capnp_rpc_net/S/index.html index 2a12a556..3d33e9c3 100644 --- a/capnp-rpc-net/Capnp_rpc_net/S/index.html +++ b/capnp-rpc-net/Capnp_rpc_net/S/index.html @@ -1,2 +1,2 @@ -S (capnp-rpc-net.Capnp_rpc_net.S)

Module Capnp_rpc_net.S

Module signatures.

module type ADDRESS = sig ... end
module type NETWORK = sig ... end
module type VAT_NETWORK = sig ... end

Stretching capability references across a network link. Note: see Capnp_rpc_unix for a higher-level wrapper for this API.

+S (capnp-rpc-net.Capnp_rpc_net.S)

Module Capnp_rpc_net.S

Module signatures.

module type ADDRESS = sig ... end
module type NETWORK = sig ... end
module type VAT_NETWORK = sig ... end

Stretching capability references across a network link. Note: see Capnp_rpc_unix for a higher-level wrapper for this API.

diff --git a/capnp-rpc-net/Capnp_rpc_net/S/module-type-ADDRESS/index.html b/capnp-rpc-net/Capnp_rpc_net/S/module-type-ADDRESS/index.html index d6f18087..f9f27426 100644 --- a/capnp-rpc-net/Capnp_rpc_net/S/module-type-ADDRESS/index.html +++ b/capnp-rpc-net/Capnp_rpc_net/S/module-type-ADDRESS/index.html @@ -1,2 +1,2 @@ -ADDRESS (capnp-rpc-net.Capnp_rpc_net.S.ADDRESS)

Module type S.ADDRESS

type t

A network address at which a vat can be reached.

val parse_uri : Uri.t -> (t * string, [> `Msg of string ]) Stdlib.result

parse_uri uri extracts from a URI the network address and service ID.

val to_uri : (t * string) -> Uri.t

to_uri (t, service_id) is a URI that can be parsed back into (t, service_id) by parse_uri.

val equal : t -> t -> bool
val digest : t -> Auth.Digest.t

How to verify that the correct address has been reached.

val pp : t Fmt.t
+ADDRESS (capnp-rpc-net.Capnp_rpc_net.S.ADDRESS)

Module type S.ADDRESS

type t

A network address at which a vat can be reached.

val parse_uri : Uri.t -> (t * string, [> `Msg of string ]) Stdlib.result

parse_uri uri extracts from a URI the network address and service ID.

val to_uri : (t * string) -> Uri.t

to_uri (t, service_id) is a URI that can be parsed back into (t, service_id) by parse_uri.

val equal : t -> t -> bool
val digest : t -> Auth.Digest.t

How to verify that the correct address has been reached.

val pp : t Fmt.t
diff --git a/capnp-rpc-net/Capnp_rpc_net/S/module-type-NETWORK/Address/index.html b/capnp-rpc-net/Capnp_rpc_net/S/module-type-NETWORK/Address/index.html index 6255669c..a8a045a6 100644 --- a/capnp-rpc-net/Capnp_rpc_net/S/module-type-NETWORK/Address/index.html +++ b/capnp-rpc-net/Capnp_rpc_net/S/module-type-NETWORK/Address/index.html @@ -1,2 +1,2 @@ -Address (capnp-rpc-net.Capnp_rpc_net.S.NETWORK.Address)

Module NETWORK.Address

type t

A network address at which a vat can be reached.

val parse_uri : Uri.t -> (t * string, [> `Msg of string ]) Stdlib.result

parse_uri uri extracts from a URI the network address and service ID.

val to_uri : (t * string) -> Uri.t

to_uri (t, service_id) is a URI that can be parsed back into (t, service_id) by parse_uri.

val equal : t -> t -> bool
val digest : t -> Auth.Digest.t

How to verify that the correct address has been reached.

val pp : t Fmt.t
+Address (capnp-rpc-net.Capnp_rpc_net.S.NETWORK.Address)

Module NETWORK.Address

type t

A network address at which a vat can be reached.

val parse_uri : Uri.t -> (t * string, [> `Msg of string ]) Stdlib.result

parse_uri uri extracts from a URI the network address and service ID.

val to_uri : (t * string) -> Uri.t

to_uri (t, service_id) is a URI that can be parsed back into (t, service_id) by parse_uri.

val equal : t -> t -> bool
val digest : t -> Auth.Digest.t

How to verify that the correct address has been reached.

val pp : t Fmt.t
diff --git a/capnp-rpc-net/Capnp_rpc_net/S/module-type-NETWORK/Types/index.html b/capnp-rpc-net/Capnp_rpc_net/S/module-type-NETWORK/Types/index.html index 036f8160..8e48bad2 100644 --- a/capnp-rpc-net/Capnp_rpc_net/S/module-type-NETWORK/Types/index.html +++ b/capnp-rpc-net/Capnp_rpc_net/S/module-type-NETWORK/Types/index.html @@ -1,2 +1,2 @@ -Types (capnp-rpc-net.Capnp_rpc_net.S.NETWORK.Types)

Module NETWORK.Types

type provision_id
type recipient_id
type third_party_cap_id
type join_key_part
+Types (capnp-rpc-net.Capnp_rpc_net.S.NETWORK.Types)

Module NETWORK.Types

type provision_id
type recipient_id
type third_party_cap_id
type join_key_part
diff --git a/capnp-rpc-net/Capnp_rpc_net/S/module-type-NETWORK/index.html b/capnp-rpc-net/Capnp_rpc_net/S/module-type-NETWORK/index.html index 517d707a..27ae1a4e 100644 --- a/capnp-rpc-net/Capnp_rpc_net/S/module-type-NETWORK/index.html +++ b/capnp-rpc-net/Capnp_rpc_net/S/module-type-NETWORK/index.html @@ -1,5 +1,5 @@ -NETWORK (capnp-rpc-net.Capnp_rpc_net.S.NETWORK)

Module type S.NETWORK

module Address : ADDRESS
type t
val connect : +NETWORK (capnp-rpc-net.Capnp_rpc_net.S.NETWORK)

Module type S.NETWORK

module Address : ADDRESS
type t
val connect : t -> sw:Eio.Switch.t -> secret_key:Auth.Secret_key.t Stdlib.Lazy.t -> diff --git a/capnp-rpc-net/Capnp_rpc_net/S/module-type-VAT_NETWORK/CapTP/index.html b/capnp-rpc-net/Capnp_rpc_net/S/module-type-VAT_NETWORK/CapTP/index.html index a066d4be..aabcb4fe 100644 --- a/capnp-rpc-net/Capnp_rpc_net/S/module-type-VAT_NETWORK/CapTP/index.html +++ b/capnp-rpc-net/Capnp_rpc_net/S/module-type-VAT_NETWORK/CapTP/index.html @@ -1,5 +1,5 @@ -CapTP (capnp-rpc-net.Capnp_rpc_net.S.VAT_NETWORK.CapTP)

Module VAT_NETWORK.CapTP

Sharing capabilities over a network link.

type t

A CapTP connection to a remote peer.

val connect : +CapTP (capnp-rpc-net.Capnp_rpc_net.S.VAT_NETWORK.CapTP)

Module VAT_NETWORK.CapTP

Sharing capabilities over a network link.

type t

A CapTP connection to a remote peer.

val connect : sw:Eio.Switch.t -> restore:restorer -> ?tags:Logs.Tag.set -> diff --git a/capnp-rpc-net/Capnp_rpc_net/S/module-type-VAT_NETWORK/Network/Address/index.html b/capnp-rpc-net/Capnp_rpc_net/S/module-type-VAT_NETWORK/Network/Address/index.html index eba3450e..8cdcfca0 100644 --- a/capnp-rpc-net/Capnp_rpc_net/S/module-type-VAT_NETWORK/Network/Address/index.html +++ b/capnp-rpc-net/Capnp_rpc_net/S/module-type-VAT_NETWORK/Network/Address/index.html @@ -1,2 +1,2 @@ -Address (capnp-rpc-net.Capnp_rpc_net.S.VAT_NETWORK.Network.Address)

Module Network.Address

type t

A network address at which a vat can be reached.

val parse_uri : Uri.t -> (t * string, [> `Msg of string ]) Stdlib.result

parse_uri uri extracts from a URI the network address and service ID.

val to_uri : (t * string) -> Uri.t

to_uri (t, service_id) is a URI that can be parsed back into (t, service_id) by parse_uri.

val equal : t -> t -> bool
val digest : t -> Auth.Digest.t

How to verify that the correct address has been reached.

val pp : t Fmt.t
+Address (capnp-rpc-net.Capnp_rpc_net.S.VAT_NETWORK.Network.Address)

Module Network.Address

type t

A network address at which a vat can be reached.

val parse_uri : Uri.t -> (t * string, [> `Msg of string ]) Stdlib.result

parse_uri uri extracts from a URI the network address and service ID.

val to_uri : (t * string) -> Uri.t

to_uri (t, service_id) is a URI that can be parsed back into (t, service_id) by parse_uri.

val equal : t -> t -> bool
val digest : t -> Auth.Digest.t

How to verify that the correct address has been reached.

val pp : t Fmt.t
diff --git a/capnp-rpc-net/Capnp_rpc_net/S/module-type-VAT_NETWORK/Network/Types/index.html b/capnp-rpc-net/Capnp_rpc_net/S/module-type-VAT_NETWORK/Network/Types/index.html index 34eca0a8..c2ef9214 100644 --- a/capnp-rpc-net/Capnp_rpc_net/S/module-type-VAT_NETWORK/Network/Types/index.html +++ b/capnp-rpc-net/Capnp_rpc_net/S/module-type-VAT_NETWORK/Network/Types/index.html @@ -1,2 +1,2 @@ -Types (capnp-rpc-net.Capnp_rpc_net.S.VAT_NETWORK.Network.Types)

Module Network.Types

type provision_id
type recipient_id
type third_party_cap_id
type join_key_part
+Types (capnp-rpc-net.Capnp_rpc_net.S.VAT_NETWORK.Network.Types)

Module Network.Types

type provision_id
type recipient_id
type third_party_cap_id
type join_key_part
diff --git a/capnp-rpc-net/Capnp_rpc_net/S/module-type-VAT_NETWORK/Network/index.html b/capnp-rpc-net/Capnp_rpc_net/S/module-type-VAT_NETWORK/Network/index.html index 87765480..c232923a 100644 --- a/capnp-rpc-net/Capnp_rpc_net/S/module-type-VAT_NETWORK/Network/index.html +++ b/capnp-rpc-net/Capnp_rpc_net/S/module-type-VAT_NETWORK/Network/index.html @@ -1,5 +1,5 @@ -Network (capnp-rpc-net.Capnp_rpc_net.S.VAT_NETWORK.Network)

Module VAT_NETWORK.Network

module Address : ADDRESS
type t
val connect : +Network (capnp-rpc-net.Capnp_rpc_net.S.VAT_NETWORK.Network)

Module VAT_NETWORK.Network

module Address : ADDRESS
type t
val connect : t -> sw:Eio.Switch.t -> secret_key:Auth.Secret_key.t Stdlib.Lazy.t -> diff --git a/capnp-rpc-net/Capnp_rpc_net/S/module-type-VAT_NETWORK/Vat/index.html b/capnp-rpc-net/Capnp_rpc_net/S/module-type-VAT_NETWORK/Vat/index.html index 265f9077..477d463f 100644 --- a/capnp-rpc-net/Capnp_rpc_net/S/module-type-VAT_NETWORK/Vat/index.html +++ b/capnp-rpc-net/Capnp_rpc_net/S/module-type-VAT_NETWORK/Vat/index.html @@ -1,5 +1,5 @@ -Vat (capnp-rpc-net.Capnp_rpc_net.S.VAT_NETWORK.Vat)

Module VAT_NETWORK.Vat

A Vat is an actor in the CapTP network, composed of objects that can call each other directly.

An actor in the CapTP network. A Vat may be connected to other Vats over CapTP network connections. Typically an application will create only a single Vat. See the Capnp_rpc_unix module for a higher-level API.

type t

A local Vat.

val create : +Vat (capnp-rpc-net.Capnp_rpc_net.S.VAT_NETWORK.Vat)

Module VAT_NETWORK.Vat

A Vat is an actor in the CapTP network, composed of objects that can call each other directly.

An actor in the CapTP network. A Vat may be connected to other Vats over CapTP network connections. Typically an application will create only a single Vat. See the Capnp_rpc_unix module for a higher-level API.

type t

A local Vat.

val create : ?tags:Logs.Tag.set -> ?restore:restorer -> ?address:Network.Address.t -> diff --git a/capnp-rpc-net/Capnp_rpc_net/S/module-type-VAT_NETWORK/index.html b/capnp-rpc-net/Capnp_rpc_net/S/module-type-VAT_NETWORK/index.html index f2b2bd7f..4ff43fc1 100644 --- a/capnp-rpc-net/Capnp_rpc_net/S/module-type-VAT_NETWORK/index.html +++ b/capnp-rpc-net/Capnp_rpc_net/S/module-type-VAT_NETWORK/index.html @@ -1,2 +1,2 @@ -VAT_NETWORK (capnp-rpc-net.Capnp_rpc_net.S.VAT_NETWORK)

Module type S.VAT_NETWORK

Stretching capability references across a network link. Note: see Capnp_rpc_unix for a higher-level wrapper for this API.

type +'a capability

An 'a capability is a capability reference to a service of type 'a.

type restorer

A function for restoring persistent capabilities from sturdy ref service IDs.

type +'a sturdy_ref

An off-line (persistent) capability.

type service_id

A (secret) token that identifies a persistent service within a vat and grants access to it.

module Network : NETWORK
module CapTP : sig ... end

Sharing capabilities over a network link.

module Vat : sig ... end

A Vat is an actor in the CapTP network, composed of objects that can call each other directly.

+VAT_NETWORK (capnp-rpc-net.Capnp_rpc_net.S.VAT_NETWORK)

Module type S.VAT_NETWORK

Stretching capability references across a network link. Note: see Capnp_rpc_unix for a higher-level wrapper for this API.

type +'a capability

An 'a capability is a capability reference to a service of type 'a.

type restorer

A function for restoring persistent capabilities from sturdy ref service IDs.

type +'a sturdy_ref

An off-line (persistent) capability.

type service_id

A (secret) token that identifies a persistent service within a vat and grants access to it.

module Network : NETWORK
module CapTP : sig ... end

Sharing capabilities over a network link.

module Vat : sig ... end

A Vat is an actor in the CapTP network, composed of objects that can call each other directly.

diff --git a/capnp-rpc-net/Capnp_rpc_net/Tls_wrapper/index.html b/capnp-rpc-net/Capnp_rpc_net/Tls_wrapper/index.html index 199e3df1..2e1305a3 100644 --- a/capnp-rpc-net/Capnp_rpc_net/Tls_wrapper/index.html +++ b/capnp-rpc-net/Capnp_rpc_net/Tls_wrapper/index.html @@ -1,5 +1,5 @@ -Tls_wrapper (capnp-rpc-net.Capnp_rpc_net.Tls_wrapper)

Module Capnp_rpc_net.Tls_wrapper

val connect_as_server : +Tls_wrapper (capnp-rpc-net.Capnp_rpc_net.Tls_wrapper)

Module Capnp_rpc_net.Tls_wrapper

val connect_as_server : [> Eio.Flow.two_way_ty | Eio.Resource.close_ty ] Eio.Std.r -> Auth.Secret_key.t option -> (Endpoint.t, [> `Msg of string ]) Stdlib.result
val connect_as_client : diff --git a/capnp-rpc-net/Capnp_rpc_net/Two_party_network/Address/index.html b/capnp-rpc-net/Capnp_rpc_net/Two_party_network/Address/index.html index e7254e95..47643cdd 100644 --- a/capnp-rpc-net/Capnp_rpc_net/Two_party_network/Address/index.html +++ b/capnp-rpc-net/Capnp_rpc_net/Two_party_network/Address/index.html @@ -1,2 +1,2 @@ -Address (capnp-rpc-net.Capnp_rpc_net.Two_party_network.Address)

Module Two_party_network.Address

type t

A network address at which a vat can be reached.

val parse_uri : Uri.t -> (t * string, [> `Msg of string ]) Stdlib.result

parse_uri uri extracts from a URI the network address and service ID.

val to_uri : (t * string) -> Uri.t

to_uri (t, service_id) is a URI that can be parsed back into (t, service_id) by parse_uri.

val equal : t -> t -> bool
val digest : t -> Auth.Digest.t

How to verify that the correct address has been reached.

val pp : t Fmt.t
+Address (capnp-rpc-net.Capnp_rpc_net.Two_party_network.Address)

Module Two_party_network.Address

type t

A network address at which a vat can be reached.

val parse_uri : Uri.t -> (t * string, [> `Msg of string ]) Stdlib.result

parse_uri uri extracts from a URI the network address and service ID.

val to_uri : (t * string) -> Uri.t

to_uri (t, service_id) is a URI that can be parsed back into (t, service_id) by parse_uri.

val equal : t -> t -> bool
val digest : t -> Auth.Digest.t

How to verify that the correct address has been reached.

val pp : t Fmt.t
diff --git a/capnp-rpc-net/Capnp_rpc_net/Two_party_network/Types/index.html b/capnp-rpc-net/Capnp_rpc_net/Two_party_network/Types/index.html index 4fe83001..842d7e08 100644 --- a/capnp-rpc-net/Capnp_rpc_net/Two_party_network/Types/index.html +++ b/capnp-rpc-net/Capnp_rpc_net/Two_party_network/Types/index.html @@ -1,2 +1,2 @@ -Types (capnp-rpc-net.Capnp_rpc_net.Two_party_network.Types)

Module Two_party_network.Types

type provision_id
type recipient_id
type third_party_cap_id
type join_key_part
+Types (capnp-rpc-net.Capnp_rpc_net.Two_party_network.Types)

Module Two_party_network.Types

type provision_id
type recipient_id
type third_party_cap_id
type join_key_part
diff --git a/capnp-rpc-net/Capnp_rpc_net/Two_party_network/index.html b/capnp-rpc-net/Capnp_rpc_net/Two_party_network/index.html index 843776b2..10936c22 100644 --- a/capnp-rpc-net/Capnp_rpc_net/Two_party_network/index.html +++ b/capnp-rpc-net/Capnp_rpc_net/Two_party_network/index.html @@ -1,5 +1,5 @@ -Two_party_network (capnp-rpc-net.Capnp_rpc_net.Two_party_network)

Module Capnp_rpc_net.Two_party_network

A network where the is only one other addressable party.

include S.NETWORK with type t = unit
type t = unit
val connect : +Two_party_network (capnp-rpc-net.Capnp_rpc_net.Two_party_network)

Module Capnp_rpc_net.Two_party_network

A network where the is only one other addressable party.

include S.NETWORK with type t = unit
type t = unit
val connect : t -> sw:Eio.Switch.t -> secret_key:Auth.Secret_key.t Stdlib.Lazy.t -> diff --git a/capnp-rpc-net/Capnp_rpc_net/index.html b/capnp-rpc-net/Capnp_rpc_net/index.html index d50f57ac..60ef8591 100644 --- a/capnp-rpc-net/Capnp_rpc_net/index.html +++ b/capnp-rpc-net/Capnp_rpc_net/index.html @@ -1,5 +1,5 @@ -Capnp_rpc_net (capnp-rpc-net.Capnp_rpc_net)

Module Capnp_rpc_net

This package adds networking support, including TLS. Libraries should not need to link against this package (just use capnp-rpc instead), since they generally shouldn't care whether services are local or remote.

module S : sig ... end

Module signatures.

module Endpoint : sig ... end

Send and receive capnp messages over a byte-stream.

module Two_party_network : sig ... end

A network where the is only one other addressable party.

module Auth : sig ... end

Vat-level authentication and encryption.

module Tls_wrapper : sig ... end
module Restorer : sig ... end
module type VAT_NETWORK = +Capnp_rpc_net (capnp-rpc-net.Capnp_rpc_net)

Module Capnp_rpc_net

This package adds networking support, including TLS. Libraries should not need to link against this package (just use capnp-rpc instead), since they generally shouldn't care whether services are local or remote.

module S : sig ... end

Module signatures.

module Endpoint : sig ... end

Send and receive capnp messages over a byte-stream.

module Two_party_network : sig ... end

A network where the is only one other addressable party.

module Auth : sig ... end

Vat-level authentication and encryption.

module Tls_wrapper : sig ... end
module Restorer : sig ... end
module type VAT_NETWORK = S.VAT_NETWORK with type 'a capability := 'a Capnp_rpc.Std.Capability.t and type restorer := Restorer.t diff --git a/capnp-rpc-net/Capnp_rpc_net/module-type-VAT_NETWORK/CapTP/index.html b/capnp-rpc-net/Capnp_rpc_net/module-type-VAT_NETWORK/CapTP/index.html index b521c02d..5dd99eaa 100644 --- a/capnp-rpc-net/Capnp_rpc_net/module-type-VAT_NETWORK/CapTP/index.html +++ b/capnp-rpc-net/Capnp_rpc_net/module-type-VAT_NETWORK/CapTP/index.html @@ -1,5 +1,5 @@ -CapTP (capnp-rpc-net.Capnp_rpc_net.VAT_NETWORK.CapTP)

Module VAT_NETWORK.CapTP

Sharing capabilities over a network link.

type t

A CapTP connection to a remote peer.

val connect : +CapTP (capnp-rpc-net.Capnp_rpc_net.VAT_NETWORK.CapTP)

Module VAT_NETWORK.CapTP

Sharing capabilities over a network link.

type t

A CapTP connection to a remote peer.

val connect : sw:Eio.Switch.t -> restore:Restorer.t -> ?tags:Logs.Tag.set -> diff --git a/capnp-rpc-net/Capnp_rpc_net/module-type-VAT_NETWORK/Network/Address/index.html b/capnp-rpc-net/Capnp_rpc_net/module-type-VAT_NETWORK/Network/Address/index.html index 0117e198..f7d2c7be 100644 --- a/capnp-rpc-net/Capnp_rpc_net/module-type-VAT_NETWORK/Network/Address/index.html +++ b/capnp-rpc-net/Capnp_rpc_net/module-type-VAT_NETWORK/Network/Address/index.html @@ -1,2 +1,2 @@ -Address (capnp-rpc-net.Capnp_rpc_net.VAT_NETWORK.Network.Address)

Module Network.Address

type t

A network address at which a vat can be reached.

val parse_uri : Uri.t -> (t * string, [> `Msg of string ]) Stdlib.result

parse_uri uri extracts from a URI the network address and service ID.

val to_uri : (t * string) -> Uri.t

to_uri (t, service_id) is a URI that can be parsed back into (t, service_id) by parse_uri.

val equal : t -> t -> bool
val digest : t -> Auth.Digest.t

How to verify that the correct address has been reached.

val pp : t Fmt.t
+Address (capnp-rpc-net.Capnp_rpc_net.VAT_NETWORK.Network.Address)

Module Network.Address

type t

A network address at which a vat can be reached.

val parse_uri : Uri.t -> (t * string, [> `Msg of string ]) Stdlib.result

parse_uri uri extracts from a URI the network address and service ID.

val to_uri : (t * string) -> Uri.t

to_uri (t, service_id) is a URI that can be parsed back into (t, service_id) by parse_uri.

val equal : t -> t -> bool
val digest : t -> Auth.Digest.t

How to verify that the correct address has been reached.

val pp : t Fmt.t
diff --git a/capnp-rpc-net/Capnp_rpc_net/module-type-VAT_NETWORK/Network/Types/index.html b/capnp-rpc-net/Capnp_rpc_net/module-type-VAT_NETWORK/Network/Types/index.html index 3fe8b65a..d6a37c2c 100644 --- a/capnp-rpc-net/Capnp_rpc_net/module-type-VAT_NETWORK/Network/Types/index.html +++ b/capnp-rpc-net/Capnp_rpc_net/module-type-VAT_NETWORK/Network/Types/index.html @@ -1,2 +1,2 @@ -Types (capnp-rpc-net.Capnp_rpc_net.VAT_NETWORK.Network.Types)

Module Network.Types

type provision_id
type recipient_id
type third_party_cap_id
type join_key_part
+Types (capnp-rpc-net.Capnp_rpc_net.VAT_NETWORK.Network.Types)

Module Network.Types

type provision_id
type recipient_id
type third_party_cap_id
type join_key_part
diff --git a/capnp-rpc-net/Capnp_rpc_net/module-type-VAT_NETWORK/Network/index.html b/capnp-rpc-net/Capnp_rpc_net/module-type-VAT_NETWORK/Network/index.html index 61ec445b..8ad6ec27 100644 --- a/capnp-rpc-net/Capnp_rpc_net/module-type-VAT_NETWORK/Network/index.html +++ b/capnp-rpc-net/Capnp_rpc_net/module-type-VAT_NETWORK/Network/index.html @@ -1,5 +1,5 @@ -Network (capnp-rpc-net.Capnp_rpc_net.VAT_NETWORK.Network)

Module VAT_NETWORK.Network

type t
val connect : +Network (capnp-rpc-net.Capnp_rpc_net.VAT_NETWORK.Network)

Module VAT_NETWORK.Network

type t
val connect : t -> sw:Eio.Switch.t -> secret_key:Auth.Secret_key.t Stdlib.Lazy.t -> diff --git a/capnp-rpc-net/Capnp_rpc_net/module-type-VAT_NETWORK/Vat/index.html b/capnp-rpc-net/Capnp_rpc_net/module-type-VAT_NETWORK/Vat/index.html index d788eeaf..6ce67a69 100644 --- a/capnp-rpc-net/Capnp_rpc_net/module-type-VAT_NETWORK/Vat/index.html +++ b/capnp-rpc-net/Capnp_rpc_net/module-type-VAT_NETWORK/Vat/index.html @@ -1,5 +1,5 @@ -Vat (capnp-rpc-net.Capnp_rpc_net.VAT_NETWORK.Vat)

Module VAT_NETWORK.Vat

A Vat is an actor in the CapTP network, composed of objects that can call each other directly.

An actor in the CapTP network. A Vat may be connected to other Vats over CapTP network connections. Typically an application will create only a single Vat. See the Capnp_rpc_unix module for a higher-level API.

type t

A local Vat.

val create : +Vat (capnp-rpc-net.Capnp_rpc_net.VAT_NETWORK.Vat)

Module VAT_NETWORK.Vat

A Vat is an actor in the CapTP network, composed of objects that can call each other directly.

An actor in the CapTP network. A Vat may be connected to other Vats over CapTP network connections. Typically an application will create only a single Vat. See the Capnp_rpc_unix module for a higher-level API.

type t

A local Vat.

val create : ?tags:Logs.Tag.set -> ?restore:Restorer.t -> ?address:Network.Address.t -> diff --git a/capnp-rpc-net/Capnp_rpc_net/module-type-VAT_NETWORK/index.html b/capnp-rpc-net/Capnp_rpc_net/module-type-VAT_NETWORK/index.html index 3ca36590..f18d2870 100644 --- a/capnp-rpc-net/Capnp_rpc_net/module-type-VAT_NETWORK/index.html +++ b/capnp-rpc-net/Capnp_rpc_net/module-type-VAT_NETWORK/index.html @@ -1,2 +1,2 @@ -VAT_NETWORK (capnp-rpc-net.Capnp_rpc_net.VAT_NETWORK)

Module type Capnp_rpc_net.VAT_NETWORK

Stretching capability references across a network link. Note: see Capnp_rpc_unix for a higher-level wrapper for this API.

module CapTP : sig ... end

Sharing capabilities over a network link.

module Vat : sig ... end

A Vat is an actor in the CapTP network, composed of objects that can call each other directly.

+VAT_NETWORK (capnp-rpc-net.Capnp_rpc_net.VAT_NETWORK)

Module type Capnp_rpc_net.VAT_NETWORK

Stretching capability references across a network link. Note: see Capnp_rpc_unix for a higher-level wrapper for this API.

module CapTP : sig ... end

Sharing capabilities over a network link.

module Vat : sig ... end

A Vat is an actor in the CapTP network, composed of objects that can call each other directly.

diff --git a/capnp-rpc-net/index.html b/capnp-rpc-net/index.html index b4804fc5..85745793 100644 --- a/capnp-rpc-net/index.html +++ b/capnp-rpc-net/index.html @@ -1,2 +1,2 @@ -index (capnp-rpc-net.index)

capnp-rpc-net index

Library capnp-rpc-net

The entry point of this library is the module: Capnp_rpc_net.

+index (capnp-rpc-net.index)

capnp-rpc-net index

Library capnp-rpc-net

The entry point of this library is the module: Capnp_rpc_net.

diff --git a/capnp-rpc-unix/Capnp_rpc_unix/CapTP/index.html b/capnp-rpc-unix/Capnp_rpc_unix/CapTP/index.html index 4c1446ef..dd7a5b09 100644 --- a/capnp-rpc-unix/Capnp_rpc_unix/CapTP/index.html +++ b/capnp-rpc-unix/Capnp_rpc_unix/CapTP/index.html @@ -1,5 +1,5 @@ -CapTP (capnp-rpc-unix.Capnp_rpc_unix.CapTP)

Module Capnp_rpc_unix.CapTP

Sharing capabilities over a network link.

type t

A CapTP connection to a remote peer.

val connect : +CapTP (capnp-rpc-unix.Capnp_rpc_unix.CapTP)

Module Capnp_rpc_unix.CapTP

Sharing capabilities over a network link.

type t

A CapTP connection to a remote peer.

val connect : sw:Eio.Switch.t -> restore:Capnp_rpc_net.Restorer.t -> ?tags:Logs.Tag.set -> diff --git a/capnp-rpc-unix/Capnp_rpc_unix/Cap_file/index.html b/capnp-rpc-unix/Capnp_rpc_unix/Cap_file/index.html index 6d52c9a8..f1e6a6e8 100644 --- a/capnp-rpc-unix/Capnp_rpc_unix/Cap_file/index.html +++ b/capnp-rpc-unix/Capnp_rpc_unix/Cap_file/index.html @@ -1,5 +1,5 @@ -Cap_file (capnp-rpc-unix.Capnp_rpc_unix.Cap_file)

Module Capnp_rpc_unix.Cap_file

Utilities for capability files.

val load : +Cap_file (capnp-rpc-unix.Capnp_rpc_unix.Cap_file)

Module Capnp_rpc_unix.Cap_file

Utilities for capability files.

val load : Vat.t -> string -> (_ Capnp_rpc.Std.Sturdy_ref.t, [> `Msg of string ]) Stdlib.result

load vat path loads the contents of path as a capability URI.

val save_sturdy : diff --git a/capnp-rpc-unix/Capnp_rpc_unix/File_store/index.html b/capnp-rpc-unix/Capnp_rpc_unix/File_store/index.html index 09d0ac79..06a3d433 100644 --- a/capnp-rpc-unix/Capnp_rpc_unix/File_store/index.html +++ b/capnp-rpc-unix/Capnp_rpc_unix/File_store/index.html @@ -1,2 +1,2 @@ -File_store (capnp-rpc-unix.Capnp_rpc_unix.File_store)

Module Capnp_rpc_unix.File_store

An on-disk store for saved services.

type 'a t

A store of values of type 'a.

val create : _ Eio.Path.t -> 'a t

create dir is a store for Cap'n Proto structs. Items are stored inside dir.

val save : 'a t -> digest:string -> 'a Capnp_rpc.StructStorage.reader_t -> unit

save t ~digest data saves data to disk in a file named base64_encode digest.

val load : 'a t -> digest:string -> 'a Capnp_rpc.StructStorage.reader_t option

load t ~digest is the data passed to save t ~digest, or None if the digest is not known.

val remove : 'a t -> digest:string -> unit

remove t ~digest removes the stored data for digest.

+File_store (capnp-rpc-unix.Capnp_rpc_unix.File_store)

Module Capnp_rpc_unix.File_store

An on-disk store for saved services.

type 'a t

A store of values of type 'a.

val create : _ Eio.Path.t -> 'a t

create dir is a store for Cap'n Proto structs. Items are stored inside dir.

val save : 'a t -> digest:string -> 'a Capnp_rpc.StructStorage.reader_t -> unit

save t ~digest data saves data to disk in a file named base64_encode digest.

val load : 'a t -> digest:string -> 'a Capnp_rpc.StructStorage.reader_t option

load t ~digest is the data passed to save t ~digest, or None if the digest is not known.

val remove : 'a t -> digest:string -> unit

remove t ~digest removes the stored data for digest.

diff --git a/capnp-rpc-unix/Capnp_rpc_unix/Network/Address/index.html b/capnp-rpc-unix/Capnp_rpc_unix/Network/Address/index.html index 184ed9b7..9ae8aa73 100644 --- a/capnp-rpc-unix/Capnp_rpc_unix/Network/Address/index.html +++ b/capnp-rpc-unix/Capnp_rpc_unix/Network/Address/index.html @@ -1,2 +1,2 @@ -Address (capnp-rpc-unix.Capnp_rpc_unix.Network.Address)

Module Network.Address

A network address at which a vat can be reached.

val parse_uri : Uri.t -> (t * string, [> `Msg of string ]) Stdlib.result

parse_uri uri extracts from a URI the network address and service ID.

val to_uri : (t * string) -> Uri.t

to_uri (t, service_id) is a URI that can be parsed back into (t, service_id) by parse_uri.

val equal : t -> t -> bool

How to verify that the correct address has been reached.

val pp : t Fmt.t
+Address (capnp-rpc-unix.Capnp_rpc_unix.Network.Address)

Module Network.Address

A network address at which a vat can be reached.

val parse_uri : Uri.t -> (t * string, [> `Msg of string ]) Stdlib.result

parse_uri uri extracts from a URI the network address and service ID.

val to_uri : (t * string) -> Uri.t

to_uri (t, service_id) is a URI that can be parsed back into (t, service_id) by parse_uri.

val equal : t -> t -> bool

How to verify that the correct address has been reached.

val pp : t Fmt.t
diff --git a/capnp-rpc-unix/Capnp_rpc_unix/Network/Location/index.html b/capnp-rpc-unix/Capnp_rpc_unix/Network/Location/index.html index c96670c9..9a638909 100644 --- a/capnp-rpc-unix/Capnp_rpc_unix/Network/Location/index.html +++ b/capnp-rpc-unix/Capnp_rpc_unix/Network/Location/index.html @@ -1,2 +1,2 @@ -Location (capnp-rpc-unix.Capnp_rpc_unix.Network.Location)

Module Network.Location

type t = [
  1. | `Unix of string
  2. | `TCP of string * int
]
val validate_public : t -> unit

Raises an exception if t is not a valid public address (e.g. the Unix path is relative)

val pp : t Fmt.t
val equal : t -> t -> bool
val unix : string -> t

unix path is a Unix-domain socket address. path is made absolute if it isn't already.

val tcp : host:string -> port:int -> t

tcp ~host port is `TCP (host, port).

val of_string : string -> (t, [> `Msg of string ]) Stdlib.result
val cmdliner_conv : t Cmdliner.Arg.conv
+Location (capnp-rpc-unix.Capnp_rpc_unix.Network.Location)

Module Network.Location

type t = [
  1. | `Unix of string
  2. | `TCP of string * int
]
val validate_public : t -> unit

Raises an exception if t is not a valid public address (e.g. the Unix path is relative)

val pp : t Fmt.t
val equal : t -> t -> bool
val unix : string -> t

unix path is a Unix-domain socket address. path is made absolute if it isn't already.

val tcp : host:string -> port:int -> t

tcp ~host port is `TCP (host, port).

val of_string : string -> (t, [> `Msg of string ]) Stdlib.result
val cmdliner_conv : t Cmdliner.Arg.conv
diff --git a/capnp-rpc-unix/Capnp_rpc_unix/Network/Types/index.html b/capnp-rpc-unix/Capnp_rpc_unix/Network/Types/index.html index 85e72e17..7f602ee1 100644 --- a/capnp-rpc-unix/Capnp_rpc_unix/Network/Types/index.html +++ b/capnp-rpc-unix/Capnp_rpc_unix/Network/Types/index.html @@ -1,2 +1,2 @@ -Types (capnp-rpc-unix.Capnp_rpc_unix.Network.Types)

Module Network.Types

type provision_id
type recipient_id
type third_party_cap_id
type join_key_part
+Types (capnp-rpc-unix.Capnp_rpc_unix.Network.Types)

Module Network.Types

type provision_id
type recipient_id
type third_party_cap_id
type join_key_part
diff --git a/capnp-rpc-unix/Capnp_rpc_unix/Network/index.html b/capnp-rpc-unix/Capnp_rpc_unix/Network/index.html index 39bf6bec..93175dc7 100644 --- a/capnp-rpc-unix/Capnp_rpc_unix/Network/index.html +++ b/capnp-rpc-unix/Capnp_rpc_unix/Network/index.html @@ -1,5 +1,5 @@ -Network (capnp-rpc-unix.Capnp_rpc_unix.Network)

Module Capnp_rpc_unix.Network

A network using TCP and Unix-domain sockets.

module Location : sig ... end
include Capnp_rpc_net.S.NETWORK +Network (capnp-rpc-unix.Capnp_rpc_unix.Network)

Module Capnp_rpc_unix.Network

A network using TCP and Unix-domain sockets.

module Location : sig ... end
include Capnp_rpc_net.S.NETWORK with type t = [ `Generic ] Eio.Net.ty Eio.Resource.t and type Address.t = Location.t * Capnp_rpc_net.Auth.Digest.t
module Address : Capnp_rpc_net.S.ADDRESS diff --git a/capnp-rpc-unix/Capnp_rpc_unix/Vat/index.html b/capnp-rpc-unix/Capnp_rpc_unix/Vat/index.html index 7a8b8cf4..fd485daf 100644 --- a/capnp-rpc-unix/Capnp_rpc_unix/Vat/index.html +++ b/capnp-rpc-unix/Capnp_rpc_unix/Vat/index.html @@ -1,5 +1,5 @@ -Vat (capnp-rpc-unix.Capnp_rpc_unix.Vat)

Module Capnp_rpc_unix.Vat

A Vat is an actor in the CapTP network, composed of objects that can call each other directly.

An actor in the CapTP network. A Vat may be connected to other Vats over CapTP network connections. Typically an application will create only a single Vat. See the Capnp_rpc_unix module for a higher-level API.

type t

A local Vat.

val create : +Vat (capnp-rpc-unix.Capnp_rpc_unix.Vat)

Module Capnp_rpc_unix.Vat

A Vat is an actor in the CapTP network, composed of objects that can call each other directly.

An actor in the CapTP network. A Vat may be connected to other Vats over CapTP network connections. Typically an application will create only a single Vat. See the Capnp_rpc_unix module for a higher-level API.

type t

A local Vat.

val create : ?tags:Logs.Tag.set -> ?restore:Capnp_rpc_net.Restorer.t -> ?address:Network.Address.t -> diff --git a/capnp-rpc-unix/Capnp_rpc_unix/Vat_config/index.html b/capnp-rpc-unix/Capnp_rpc_unix/Vat_config/index.html index 8cc3b798..106e5d31 100644 --- a/capnp-rpc-unix/Capnp_rpc_unix/Vat_config/index.html +++ b/capnp-rpc-unix/Capnp_rpc_unix/Vat_config/index.html @@ -1,5 +1,5 @@ -Vat_config (capnp-rpc-unix.Capnp_rpc_unix.Vat_config)

Module Capnp_rpc_unix.Vat_config

Configuration for a Vat.

type t
val create : +Vat_config (capnp-rpc-unix.Capnp_rpc_unix.Vat_config)

Module Capnp_rpc_unix.Vat_config

Configuration for a Vat.

type t
val create : ?backlog:int -> ?public_address:Network.Location.t -> secret_key:[< `File of _ Eio.Path.t | `PEM of string | `Ephemeral ] -> diff --git a/capnp-rpc-unix/Capnp_rpc_unix/index.html b/capnp-rpc-unix/Capnp_rpc_unix/index.html index f6e1de47..cfc2f090 100644 --- a/capnp-rpc-unix/Capnp_rpc_unix/index.html +++ b/capnp-rpc-unix/Capnp_rpc_unix/index.html @@ -1,5 +1,5 @@ -Capnp_rpc_unix (capnp-rpc-unix.Capnp_rpc_unix)

Module Capnp_rpc_unix

Helpers for using Capnp_rpc on traditional operating systems.

include Capnp_rpc_net.VAT_NETWORK with module Network = Network
module Network : sig ... end

A network using TCP and Unix-domain sockets.

module CapTP : sig ... end

Sharing capabilities over a network link.

module Vat : sig ... end

A Vat is an actor in the CapTP network, composed of objects that can call each other directly.

module Vat_config : sig ... end

Configuration for a Vat.

module File_store : sig ... end

An on-disk store for saved services.

module Cap_file : sig ... end

Utilities for capability files.

val sturdy_uri : Uri.t Cmdliner.Arg.conv

A cmdliner argument converter for a "capnp://" URI (or the path of a file containing such a URI).

val connect_with_progress : +Capnp_rpc_unix (capnp-rpc-unix.Capnp_rpc_unix)

Module Capnp_rpc_unix

Helpers for using Capnp_rpc on traditional operating systems.

include Capnp_rpc_net.VAT_NETWORK with module Network = Network
module Network : sig ... end

A network using TCP and Unix-domain sockets.

module CapTP : sig ... end

Sharing capabilities over a network link.

module Vat : sig ... end

A Vat is an actor in the CapTP network, composed of objects that can call each other directly.

module Vat_config : sig ... end

Configuration for a Vat.

module File_store : sig ... end

An on-disk store for saved services.

module Cap_file : sig ... end

Utilities for capability files.

val sturdy_uri : Uri.t Cmdliner.Arg.conv

A cmdliner argument converter for a "capnp://" URI (or the path of a file containing such a URI).

val connect_with_progress : ?mode:[ `Auto | `Log | `Batch | `Console | `Silent ] -> 'a Capnp_rpc.Std.Sturdy_ref.t -> ('a Capnp_rpc.Std.Capability.t, Capnp_rpc.Exception.t) Stdlib.result

connect_with_progress sr is like Sturdy_ref.connect, but shows that a connection is in progress. Note: On failure, it does not display the error, which should instead be handled by the caller.

  • parameter mode

    Controls how progress is displayed:

    • `Log writes info-level log messages about starting and completing the connection.
    • `Batch prints a message to stderr when starting, then prints OK when done.
    • `Console displays a message while connecting if it takes too long, then erases it when done.
    • `Silent does nothing.
    • `Auto (the default) tries to log (as for `Log), but if the log message isn't used then it behaves as `Console (if stderr is a tty) or as `Batch (if not).
val with_cap_exn : diff --git a/capnp-rpc-unix/index.html b/capnp-rpc-unix/index.html index 6939fea4..f0611559 100644 --- a/capnp-rpc-unix/index.html +++ b/capnp-rpc-unix/index.html @@ -1,2 +1,2 @@ -index (capnp-rpc-unix.index)

capnp-rpc-unix index

Library capnp-rpc-unix

The entry point of this library is the module: Capnp_rpc_unix.

+index (capnp-rpc-unix.index)

capnp-rpc-unix index

Library capnp-rpc-unix

The entry point of this library is the module: Capnp_rpc_unix.

diff --git a/capnp-rpc/Capnp_rpc/Capability/Request/index.html b/capnp-rpc/Capnp_rpc/Capability/Request/index.html index ad4df81c..3844dfa6 100644 --- a/capnp-rpc/Capnp_rpc/Capability/Request/index.html +++ b/capnp-rpc/Capnp_rpc/Capability/Request/index.html @@ -1,2 +1,2 @@ -Request (capnp-rpc.Capnp_rpc.Capability.Request)

Module Capability.Request

type 'a t

An 'a t is a builder for the out-going request's payload.

val create : ?message_size:int -> (Capnp.Message.rw Slice.t -> 'a) -> 'a t * 'a

create init is a fresh request payload and contents builder. Use one of the generated init_pointer functions for init.

  • parameter message_size

    An estimate of the size of the payload. If this is too small, additional segments will be allocated automatically, but this is less efficient than getting the size right to start with.

val create_no_args : unit -> 'a t

create_no_args () is a payload with no content.

val release : 'a t -> unit

Clear the exported refs, dropping their ref-counts. This is called automatically when you send a message, but you might need it if you decide to abort.

+Request (capnp-rpc.Capnp_rpc.Capability.Request)

Module Capability.Request

type 'a t

An 'a t is a builder for the out-going request's payload.

val create : ?message_size:int -> (Capnp.Message.rw Slice.t -> 'a) -> 'a t * 'a

create init is a fresh request payload and contents builder. Use one of the generated init_pointer functions for init.

  • parameter message_size

    An estimate of the size of the payload. If this is too small, additional segments will be allocated automatically, but this is less efficient than getting the size right to start with.

val create_no_args : unit -> 'a t

create_no_args () is a payload with no content.

val release : 'a t -> unit

Clear the exported refs, dropping their ref-counts. This is called automatically when you send a message, but you might need it if you decide to abort.

diff --git a/capnp-rpc/Capnp_rpc/Capability/index.html b/capnp-rpc/Capnp_rpc/Capability/index.html index 3a2c8d20..53f927f4 100644 --- a/capnp-rpc/Capnp_rpc/Capability/index.html +++ b/capnp-rpc/Capnp_rpc/Capability/index.html @@ -1,5 +1,5 @@ -Capability (capnp-rpc.Capnp_rpc.Capability)

Module Capnp_rpc.Capability

A capability is a reference to an object, or to a promise for an object. You can invoke methods on a capability even while it is still only a promise.

type +'a t

An 'a t is a capability reference to a service of type 'a.

val broken : Exception.t -> 'a t

broken ex is a broken capability, with problem ex. Any attempt to call methods on it will fail with ex.

val when_broken : (Exception.t -> unit) -> 'a t -> unit

when_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. If x's ref-count reaches zero without fn being called, it will never be called.

val when_released : 'a t -> (unit -> unit) -> unit

when_released t fn will call fn () when t's ref-count drops to zero. This is used for caches, to remove entries when they become invalid. For promises, fn will be transferred to the resolution if resolved. For broken caps, this method does nothing (exceptions are never released).

val problem : 'a t -> Exception.t option

problem t is Some ex if t is broken, or None if it is still believed to be healthy. Once a capability is broken, it will never work again and any calls made on it will fail with exception ex.

val await_settled : 'a t -> (unit, Exception.t) Stdlib.result

await_settled t resolves once t is a "settled" (non-promise) reference. If t is a near, far or broken reference, this returns immediately. If it is currently a local or remote promise, it waits until it isn't. wait_until_settled takes ownership of t until it returns (you must not dec_ref it before then).

  • returns

    Ok () on success, or Error _ if t failed.

  • since 1.2
val await_settled_exn : 'a t -> unit

Like await_settled, but raises an exception on error.

  • since 1.2
val equal : 'a t -> 'a t -> (bool, [ `Unsettled ]) Stdlib.result

equal a b indicates whether a and b designate the same settled service. Returns Error `Unsettled if a or b is still a promise (and they therefore may yet turn out to be equal when the promise resolves).

module Request : sig ... end
val call : +Capability (capnp-rpc.Capnp_rpc.Capability)

Module Capnp_rpc.Capability

A capability is a reference to an object, or to a promise for an object. You can invoke methods on a capability even while it is still only a promise.

type +'a t

An 'a t is a capability reference to a service of type 'a.

val broken : Exception.t -> 'a t

broken ex is a broken capability, with problem ex. Any attempt to call methods on it will fail with ex.

val when_broken : (Exception.t -> unit) -> 'a t -> unit

when_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. If x's ref-count reaches zero without fn being called, it will never be called.

val when_released : 'a t -> (unit -> unit) -> unit

when_released t fn will call fn () when t's ref-count drops to zero. This is used for caches, to remove entries when they become invalid. For promises, fn will be transferred to the resolution if resolved. For broken caps, this method does nothing (exceptions are never released).

val problem : 'a t -> Exception.t option

problem t is Some ex if t is broken, or None if it is still believed to be healthy. Once a capability is broken, it will never work again and any calls made on it will fail with exception ex.

val await_settled : 'a t -> (unit, Exception.t) Stdlib.result

await_settled t resolves once t is a "settled" (non-promise) reference. If t is a near, far or broken reference, this returns immediately. If it is currently a local or remote promise, it waits until it isn't. wait_until_settled takes ownership of t until it returns (you must not dec_ref it before then).

  • returns

    Ok () on success, or Error _ if t failed.

  • since 1.2
val await_settled_exn : 'a t -> unit

Like await_settled, but raises an exception on error.

  • since 1.2
val equal : 'a t -> 'a t -> (bool, [ `Unsettled ]) Stdlib.result

equal a b indicates whether a and b designate the same settled service. Returns Error `Unsettled if a or b is still a promise (and they therefore may yet turn out to be equal when the promise resolves).

module Request : sig ... end
val call : 't t -> ('t, 'a, 'b StructStorage.reader_t) Capnp.RPC.MethodID.t -> 'a Request.t -> diff --git a/capnp-rpc/Capnp_rpc/Leak_handler/index.html b/capnp-rpc/Capnp_rpc/Leak_handler/index.html index 36e0e5ed..0eb9ab0c 100644 --- a/capnp-rpc/Capnp_rpc/Leak_handler/index.html +++ b/capnp-rpc/Capnp_rpc/Leak_handler/index.html @@ -1,2 +1,2 @@ -Leak_handler (capnp-rpc.Capnp_rpc.Leak_handler)

Module Capnp_rpc.Leak_handler

Handle references that got GC'd with a non-zero ref-count.

If an application forgets to release a resource and it gets GC'd then we want to log a warning and clean up (so forgotten refs don't build up over time).

Because GC finalizers can run at any time and from any thread, we need to pass the cleanup callback to a fiber running in the owning thread.

val run : unit -> 'a

run () registers a leak handler for the current thread and runs a loop that waits for callbacks and runs them. If the fiber is cancelled, the handler is removed.

Each vat runs this in a daemon fiber. It is safe to have multiple such fibers running in a single systhread.

val ref_leak_detected : int -> (unit -> unit) -> unit

ref_leak_detected thread_id fn should be called from a GC finalizer if the resource was not properly released.

If a handler for thread_id is running (see run) then it will schedule fn to run at a safe point in that thread. If not, fn is ignored.

+Leak_handler (capnp-rpc.Capnp_rpc.Leak_handler)

Module Capnp_rpc.Leak_handler

Handle references that got GC'd with a non-zero ref-count.

If an application forgets to release a resource and it gets GC'd then we want to log a warning and clean up (so forgotten refs don't build up over time).

Because GC finalizers can run at any time and from any thread, we need to pass the cleanup callback to a fiber running in the owning thread.

val run : unit -> 'a

run () registers a leak handler for the current thread and runs a loop that waits for callbacks and runs them. If the fiber is cancelled, the handler is removed.

Each vat runs this in a daemon fiber. It is safe to have multiple such fibers running in a single systhread.

val ref_leak_detected : int -> (unit -> unit) -> unit

ref_leak_detected thread_id fn should be called from a GC finalizer if the resource was not properly released.

If a handler for thread_id is running (see run) then it will schedule fn to run at a safe point in that thread. If not, fn is ignored.

diff --git a/capnp-rpc/Capnp_rpc/ListStorage/index.html b/capnp-rpc/Capnp_rpc/ListStorage/index.html index 48438a18..7e4ed63c 100644 --- a/capnp-rpc/Capnp_rpc/ListStorage/index.html +++ b/capnp-rpc/Capnp_rpc/ListStorage/index.html @@ -1,2 +1,2 @@ -ListStorage (capnp-rpc.Capnp_rpc.ListStorage)

Module Capnp_rpc.ListStorage

type !'cap t = 'cap Capnp__Message.BytesMessage.ListStorage.t = {
  1. storage : 'cap Slice.t;
  2. storage_type : Capnp__.ListStorageType.t;
  3. num_elements : int;
}
val readonly : 'cap t -> Capnp__MessageSig.ro t
+ListStorage (capnp-rpc.Capnp_rpc.ListStorage)

Module Capnp_rpc.ListStorage

type !'cap t = 'cap Capnp__Message.BytesMessage.ListStorage.t = {
  1. storage : 'cap Slice.t;
  2. storage_type : Capnp__.ListStorageType.t;
  3. num_elements : int;
}
val readonly : 'cap t -> Capnp__MessageSig.ro t
diff --git a/capnp-rpc/Capnp_rpc/Message/index.html b/capnp-rpc/Capnp_rpc/Message/index.html index 74b07774..b2f5c1fa 100644 --- a/capnp-rpc/Capnp_rpc/Message/index.html +++ b/capnp-rpc/Capnp_rpc/Message/index.html @@ -1,2 +1,2 @@ -Message (capnp-rpc.Capnp_rpc.Message)

Module Capnp_rpc.Message

type storage_t = Stdlib.Bytes.t
type storage_descr_t = Capnp__Message.BytesMessage.Message.storage_descr_t = {
  1. segment : storage_t;
  2. bytes_consumed : int;
}
type 'cap t = 'cap Capnp__Message.BytesMessage.Message.t
val create : int -> Capnp__MessageSig.rw t
val release : 'cap t -> unit
val num_segments : 'cap t -> int
val total_size : 'cap t -> int
val total_alloc_size : 'cap t -> int
val get_segment : 'cap t -> int -> 'cap Segment.t
val readonly : 'cap t -> Capnp__MessageSig.ro t
val of_storage : storage_t list -> Capnp__MessageSig.rw t
val to_storage : 'cap t -> storage_descr_t list
val with_message : 'cap t -> f:('cap t -> 'a) -> 'a
val with_attachments : Capnp__MessageSig.attachments -> 'cap t -> 'cap t
val get_attachments : 'cap t -> Capnp__MessageSig.attachments
+Message (capnp-rpc.Capnp_rpc.Message)

Module Capnp_rpc.Message

type storage_t = Stdlib.Bytes.t
type storage_descr_t = Capnp__Message.BytesMessage.Message.storage_descr_t = {
  1. segment : storage_t;
  2. bytes_consumed : int;
}
type 'cap t = 'cap Capnp__Message.BytesMessage.Message.t
val create : int -> Capnp__MessageSig.rw t
val release : 'cap t -> unit
val num_segments : 'cap t -> int
val total_size : 'cap t -> int
val total_alloc_size : 'cap t -> int
val get_segment : 'cap t -> int -> 'cap Segment.t
val readonly : 'cap t -> Capnp__MessageSig.ro t
val of_storage : storage_t list -> Capnp__MessageSig.rw t
val to_storage : 'cap t -> storage_descr_t list
val with_message : 'cap t -> f:('cap t -> 'a) -> 'a
val with_attachments : Capnp__MessageSig.attachments -> 'cap t -> 'cap t
val get_attachments : 'cap t -> Capnp__MessageSig.attachments
diff --git a/capnp-rpc/Capnp_rpc/Object/index.html b/capnp-rpc/Capnp_rpc/Object/index.html index 40482714..6fa54dbd 100644 --- a/capnp-rpc/Capnp_rpc/Object/index.html +++ b/capnp-rpc/Capnp_rpc/Object/index.html @@ -1,2 +1,2 @@ -Object (capnp-rpc.Capnp_rpc.Object)

Module Capnp_rpc.Object

type (!'cap, !'a) t = ('cap, 'a) Capnp__Message.BytesMessage.Object.t =
  1. | None
  2. | List of 'cap ListStorage.t
  3. | Struct of ('cap, 'a) StructStorage.t
+Object (capnp-rpc.Capnp_rpc.Object)

Module Capnp_rpc.Object

type (!'cap, !'a) t = ('cap, 'a) Capnp__Message.BytesMessage.Object.t =
  1. | None
  2. | List of 'cap ListStorage.t
  3. | Struct of ('cap, 'a) StructStorage.t
diff --git a/capnp-rpc/Capnp_rpc/Persistence/class-type-persistent/index.html b/capnp-rpc/Capnp_rpc/Persistence/class-type-persistent/index.html index 3e27a4ea..a2806094 100644 --- a/capnp-rpc/Capnp_rpc/Persistence/class-type-persistent/index.html +++ b/capnp-rpc/Capnp_rpc/Persistence/class-type-persistent/index.html @@ -1,2 +1,2 @@ -persistent (capnp-rpc.Capnp_rpc.Persistence.persistent)

Class type Persistence.persistent

method save : ('a Sturdy_ref.t, Exception.t) Stdlib.result
+persistent (capnp-rpc.Capnp_rpc.Persistence.persistent)

Class type Persistence.persistent

method save : ('a Sturdy_ref.t, Exception.t) Stdlib.result
diff --git a/capnp-rpc/Capnp_rpc/Persistence/index.html b/capnp-rpc/Capnp_rpc/Persistence/index.html index aab11aba..0f8ab51b 100644 --- a/capnp-rpc/Capnp_rpc/Persistence/index.html +++ b/capnp-rpc/Capnp_rpc/Persistence/index.html @@ -1,5 +1,5 @@ -Persistence (capnp-rpc.Capnp_rpc.Persistence)

Module Capnp_rpc.Persistence

class type 'a persistent = object ... end
val with_persistence : +Persistence (capnp-rpc.Capnp_rpc.Persistence)

Module Capnp_rpc.Persistence

class type 'a persistent = object ... end
val with_persistence : 'a persistent -> ('impl -> 'a Capability.t) -> {Untyped}1.generic_service as 'impl -> diff --git a/capnp-rpc/Capnp_rpc/Segment/index.html b/capnp-rpc/Capnp_rpc/Segment/index.html index f4bec9fc..a3173a25 100644 --- a/capnp-rpc/Capnp_rpc/Segment/index.html +++ b/capnp-rpc/Capnp_rpc/Segment/index.html @@ -1,5 +1,5 @@ -Segment (capnp-rpc.Capnp_rpc.Segment)

Module Capnp_rpc.Segment

type storage_t = Stdlib.Bytes.t
type 'cap t = 'cap Capnp__Message.BytesMessage.Segment.t
val alloc : int -> Capnp__MessageSig.rw t
val release : 'cap t -> unit
val length : 'cap t -> int
val readonly : 'cap t -> Capnp__MessageSig.ro t
val of_storage : storage_t -> Capnp__MessageSig.rw t
val to_storage : 'cap t -> storage_t
val get_uint8 : 'cap t -> int -> int
val get_uint16 : 'cap t -> int -> int
val get_uint32 : 'cap t -> int -> Capnp__MessageSig.Uint32.t
val get_uint64 : 'cap t -> int -> Capnp__MessageSig.Uint64.t
val get_int8 : 'cap t -> int -> int
val get_int16 : 'cap t -> int -> int
val get_int32 : 'cap t -> int -> Stdlib.Int32.t
val get_int64 : 'cap t -> int -> Stdlib.Int64.t
val set_uint8 : Capnp__MessageSig.rw t -> int -> int -> unit
val set_uint16 : Capnp__MessageSig.rw t -> int -> int -> unit
val set_uint32 : +Segment (capnp-rpc.Capnp_rpc.Segment)

Module Capnp_rpc.Segment

type storage_t = Stdlib.Bytes.t
type 'cap t = 'cap Capnp__Message.BytesMessage.Segment.t
val alloc : int -> Capnp__MessageSig.rw t
val release : 'cap t -> unit
val length : 'cap t -> int
val readonly : 'cap t -> Capnp__MessageSig.ro t
val of_storage : storage_t -> Capnp__MessageSig.rw t
val to_storage : 'cap t -> storage_t
val get_uint8 : 'cap t -> int -> int
val get_uint16 : 'cap t -> int -> int
val get_uint32 : 'cap t -> int -> Capnp__MessageSig.Uint32.t
val get_uint64 : 'cap t -> int -> Capnp__MessageSig.Uint64.t
val get_int8 : 'cap t -> int -> int
val get_int16 : 'cap t -> int -> int
val get_int32 : 'cap t -> int -> Stdlib.Int32.t
val get_int64 : 'cap t -> int -> Stdlib.Int64.t
val set_uint8 : Capnp__MessageSig.rw t -> int -> int -> unit
val set_uint16 : Capnp__MessageSig.rw t -> int -> int -> unit
val set_uint32 : Capnp__MessageSig.rw t -> int -> Capnp__MessageSig.Uint32.t -> diff --git a/capnp-rpc/Capnp_rpc/Service/Response/index.html b/capnp-rpc/Capnp_rpc/Service/Response/index.html index 015ffb81..90a362ed 100644 --- a/capnp-rpc/Capnp_rpc/Service/Response/index.html +++ b/capnp-rpc/Capnp_rpc/Service/Response/index.html @@ -1,2 +1,2 @@ -Response (capnp-rpc.Capnp_rpc.Service.Response)

Module Service.Response

type 'b t

An 'a t is a builder for the out-going response.

val create : ?message_size:int -> (Capnp.Message.rw Slice.t -> 'a) -> 'a t * 'a

create init is a fresh response and contents builder. Use one of the generated init_pointer functions for init.

val create_empty : unit -> 'a t

empty () is an empty response.

val release : 'a t -> unit

Clear the exported refs, dropping their ref-counts. This is called automatically when you send a message, but you might need it if you decide to abort.

+Response (capnp-rpc.Capnp_rpc.Service.Response)

Module Service.Response

type 'b t

An 'a t is a builder for the out-going response.

val create : ?message_size:int -> (Capnp.Message.rw Slice.t -> 'a) -> 'a t * 'a

create init is a fresh response and contents builder. Use one of the generated init_pointer functions for init.

val create_empty : unit -> 'a t

empty () is an empty response.

val release : 'a t -> unit

Clear the exported refs, dropping their ref-counts. This is called automatically when you send a message, but you might need it if you decide to abort.

diff --git a/capnp-rpc/Capnp_rpc/Service/index.html b/capnp-rpc/Capnp_rpc/Service/index.html index eb531ae5..2b5e2154 100644 --- a/capnp-rpc/Capnp_rpc/Service/index.html +++ b/capnp-rpc/Capnp_rpc/Service/index.html @@ -1,5 +1,5 @@ -Service (capnp-rpc.Capnp_rpc.Service)

Module Capnp_rpc.Service

Functions for service implementors.

type ('a, 'b) method_t = 'a -> (unit -> unit) -> 'b StructRef.t

An ('a, 'b) method_t is a method implementation that takes a reader for the parameters and a function to release the capabilities in the parameters, and returns a promise for the results.

module Response : sig ... end
val return : 'a Response.t -> 'a StructRef.t

return r wraps up a simple local result as a promise.

val return_empty : unit -> 'a StructRef.t

return_empty () is a promise for a response with no payload.

val error : Error.t -> 'a StructRef.t

error e is a broken promise for a struct, with error e.

val fail : +Service (capnp-rpc.Capnp_rpc.Service)

Module Capnp_rpc.Service

Functions for service implementors.

type ('a, 'b) method_t = 'a -> (unit -> unit) -> 'b StructRef.t

An ('a, 'b) method_t is a method implementation that takes a reader for the parameters and a function to release the capabilities in the parameters, and returns a promise for the results.

module Response : sig ... end
val return : 'a Response.t -> 'a StructRef.t

return r wraps up a simple local result as a promise.

val return_empty : unit -> 'a StructRef.t

return_empty () is a promise for a response with no payload.

val error : Error.t -> 'a StructRef.t

error e is a broken promise for a struct, with error e.

val fail : ?ty:Exception.ty -> ('a, Stdlib.Format.formatter, unit, 'b StructRef.t) Stdlib.format4 -> 'a

fail msg is an exception error with reason msg.

diff --git a/capnp-rpc/Capnp_rpc/Slice/index.html b/capnp-rpc/Capnp_rpc/Slice/index.html index 47e3f602..9c53b17f 100644 --- a/capnp-rpc/Capnp_rpc/Slice/index.html +++ b/capnp-rpc/Capnp_rpc/Slice/index.html @@ -1,5 +1,5 @@ -Slice (capnp-rpc.Capnp_rpc.Slice)

Module Capnp_rpc.Slice

type !'cap t = 'cap Capnp__Message.BytesMessage.Slice.t = {
  1. msg : 'cap Message.t;
  2. segment : 'cap Segment.t;
  3. segment_id : int;
  4. start : int;
  5. len : int;
}
val alloc : Capnp__MessageSig.rw Message.t -> int -> Capnp__MessageSig.rw t
val alloc_in_segment : +Slice (capnp-rpc.Capnp_rpc.Slice)

Module Capnp_rpc.Slice

type !'cap t = 'cap Capnp__Message.BytesMessage.Slice.t = {
  1. msg : 'cap Message.t;
  2. segment : 'cap Segment.t;
  3. segment_id : int;
  4. start : int;
  5. len : int;
}
val alloc : Capnp__MessageSig.rw Message.t -> int -> Capnp__MessageSig.rw t
val alloc_in_segment : Capnp__MessageSig.rw Message.t -> int -> int -> diff --git a/capnp-rpc/Capnp_rpc/Std/index.html b/capnp-rpc/Capnp_rpc/Std/index.html index cbe29ef4..84b9a1de 100644 --- a/capnp-rpc/Capnp_rpc/Std/index.html +++ b/capnp-rpc/Capnp_rpc/Std/index.html @@ -1,2 +1,2 @@ -Std (capnp-rpc.Capnp_rpc.Std)

Module Capnp_rpc.Std

Some aliases for common modules.

This is intended to be opened, as open Capnp_rpc.Std.

module Sturdy_ref = Sturdy_ref
module Capability = Capability
module Service = Service
+Std (capnp-rpc.Capnp_rpc.Std)

Module Capnp_rpc.Std

Some aliases for common modules.

This is intended to be opened, as open Capnp_rpc.Std.

module Sturdy_ref = Sturdy_ref
module Capability = Capability
module Service = Service
diff --git a/capnp-rpc/Capnp_rpc/StructRef/index.html b/capnp-rpc/Capnp_rpc/StructRef/index.html index 719163ad..1de72ef2 100644 --- a/capnp-rpc/Capnp_rpc/StructRef/index.html +++ b/capnp-rpc/Capnp_rpc/StructRef/index.html @@ -1,2 +1,2 @@ -StructRef (capnp-rpc.Capnp_rpc.StructRef)

Module Capnp_rpc.StructRef

A promise for a response structure. You can use the generated _get_pipelined functions on a promise to get a promise for a capability inside the promise, and then pipeline messages to that promise without waiting for the response struct to arrive.

type 'a t

An 'a t is a reference to a response message (that may not have arrived yet) with content type 'a.

val inc_ref : 'a t -> unit

inc_ref t increases the reference count on t by one.

val dec_ref : 'a t -> unit

dec_ref t reduces the reference count on t by one. When the count reaches zero, this result must never be used again. If the results have not yet arrived when the count reaches zero, we send a cancellation request (which may or may not succeed). As soon as the results are available, they are released.

+StructRef (capnp-rpc.Capnp_rpc.StructRef)

Module Capnp_rpc.StructRef

A promise for a response structure. You can use the generated _get_pipelined functions on a promise to get a promise for a capability inside the promise, and then pipeline messages to that promise without waiting for the response struct to arrive.

type 'a t

An 'a t is a reference to a response message (that may not have arrived yet) with content type 'a.

val inc_ref : 'a t -> unit

inc_ref t increases the reference count on t by one.

val dec_ref : 'a t -> unit

dec_ref t reduces the reference count on t by one. When the count reaches zero, this result must never be used again. If the results have not yet arrived when the count reaches zero, we send a cancellation request (which may or may not succeed). As soon as the results are available, they are released.

diff --git a/capnp-rpc/Capnp_rpc/StructStorage/index.html b/capnp-rpc/Capnp_rpc/StructStorage/index.html index 6d45a6e5..b35fd407 100644 --- a/capnp-rpc/Capnp_rpc/StructStorage/index.html +++ b/capnp-rpc/Capnp_rpc/StructStorage/index.html @@ -1,5 +1,5 @@ -StructStorage (capnp-rpc.Capnp_rpc.StructStorage)

Module Capnp_rpc.StructStorage

type (!'cap, !+'a) t = +StructStorage (capnp-rpc.Capnp_rpc.StructStorage)

Module Capnp_rpc.StructStorage

type (!'cap, !+'a) t = private ('cap, 'a) Capnp__Message.BytesMessage.StructStorage.t = {
  1. data : 'cap Slice.t;
  2. pointers : 'cap Slice.t;
}
val readonly : ('cap, 'a) t -> (Capnp__MessageSig.ro, 'a) t
val with_attachments : Capnp__MessageSig.attachments -> diff --git a/capnp-rpc/Capnp_rpc/Sturdy_ref/index.html b/capnp-rpc/Capnp_rpc/Sturdy_ref/index.html index 50cac39f..02157f8c 100644 --- a/capnp-rpc/Capnp_rpc/Sturdy_ref/index.html +++ b/capnp-rpc/Capnp_rpc/Sturdy_ref/index.html @@ -1,5 +1,5 @@ -Sturdy_ref (capnp-rpc.Capnp_rpc.Sturdy_ref)

Module Capnp_rpc.Sturdy_ref

type +'a t

An off-line (persistent) capability reference.

A sturdy ref contains all the information necessary to get a live reference to a service:

  • The network address of the hosting vat (e.g. TCP host and port)
  • A way to authenticate the hosting vat (e.g. a fingerprint of the vat's public key)
  • A way to identify the target service within the vat and prove permission to access it (e.g. a "Swiss number")
val connect : 'a t -> ('a Capability.t, Exception.t) Stdlib.result

connect t returns a live reference to t's service.

val connect_exn : 'a t -> 'a Capability.t

connect_exn is a wrapper for connect that raises an exception on error.

val with_cap : +Sturdy_ref (capnp-rpc.Capnp_rpc.Sturdy_ref)

Module Capnp_rpc.Sturdy_ref

type +'a t

An off-line (persistent) capability reference.

A sturdy ref contains all the information necessary to get a live reference to a service:

  • The network address of the hosting vat (e.g. TCP host and port)
  • A way to authenticate the hosting vat (e.g. a fingerprint of the vat's public key)
  • A way to identify the target service within the vat and prove permission to access it (e.g. a "Swiss number")
val connect : 'a t -> ('a Capability.t, Exception.t) Stdlib.result

connect t returns a live reference to t's service.

val connect_exn : 'a t -> 'a Capability.t

connect_exn is a wrapper for connect that raises an exception on error.

val with_cap : 'a t -> ('a Capability.t -> ('b, [> `Capnp of Exception.t ] as 'e) Stdlib.result) -> ('b, 'e) Stdlib.result

with_cap t f uses connect t to get a live-ref x, then does Capability.with_ref x f.

val with_cap_exn : 'a t -> ('a Capability.t -> 'b) -> 'b

with_cap_exn t f uses connect_exn t to get a live-ref x, then does Capability.with_ref x f.

val reader : diff --git a/capnp-rpc/Capnp_rpc/index.html b/capnp-rpc/Capnp_rpc/index.html index a04ec183..12fdf9e2 100644 --- a/capnp-rpc/Capnp_rpc/index.html +++ b/capnp-rpc/Capnp_rpc/index.html @@ -1,2 +1,2 @@ -Capnp_rpc (capnp-rpc.Capnp_rpc)

Module Capnp_rpc

Cap'n Proto core API for defining and using services.

include module type of Capnp.BytesMessage
module Segment : sig ... end
module Message : sig ... end
module Slice : sig ... end
module StructStorage : sig ... end
module ListStorage : sig ... end
module Object : sig ... end
module Exception = Capnp_rpc_proto.Exception
module Error = Capnp_rpc_proto.Error
module StructRef : sig ... end

A promise for a response structure. You can use the generated _get_pipelined functions on a promise to get a promise for a capability inside the promise, and then pipeline messages to that promise without waiting for the response struct to arrive.

module Capability : sig ... end

A capability is a reference to an object, or to a promise for an object. You can invoke methods on a capability even while it is still only a promise.

module Sturdy_ref : sig ... end
module Service : sig ... end

Functions for service implementors.

module Std : sig ... end

Some aliases for common modules.

module Leak_handler : sig ... end

Handle references that got GC'd with a non-zero ref-count.

module Persistence : sig ... end
+Capnp_rpc (capnp-rpc.Capnp_rpc)

Module Capnp_rpc

Cap'n Proto core API for defining and using services.

include module type of Capnp.BytesMessage
module Segment : sig ... end
module Message : sig ... end
module Slice : sig ... end
module StructStorage : sig ... end
module ListStorage : sig ... end
module Object : sig ... end
module Exception = Capnp_rpc_proto.Exception
module Error = Capnp_rpc_proto.Error
module StructRef : sig ... end

A promise for a response structure. You can use the generated _get_pipelined functions on a promise to get a promise for a capability inside the promise, and then pipeline messages to that promise without waiting for the response struct to arrive.

module Capability : sig ... end

A capability is a reference to an object, or to a promise for an object. You can invoke methods on a capability even while it is still only a promise.

module Sturdy_ref : sig ... end
module Service : sig ... end

Functions for service implementors.

module Std : sig ... end

Some aliases for common modules.

module Leak_handler : sig ... end

Handle references that got GC'd with a non-zero ref-count.

module Persistence : sig ... end
diff --git a/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Core_types/Attachments/index.html b/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Core_types/Attachments/index.html index 8a126118..9fb2f7d4 100644 --- a/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Core_types/Attachments/index.html +++ b/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Core_types/Attachments/index.html @@ -1,2 +1,2 @@ -Attachments (capnp-rpc.Capnp_rpc_proto.CapTP.Make.EP.Core_types.Attachments)

Module Core_types.Attachments

val builder : unit -> S.attachments

builder () is a fresh writable attachments array.

val cap : int -> S.attachments -> cap

cap i t is the capability at index i in t. The reference count is increased by one.

val clear_cap : S.attachments -> int -> unit

Replace cap at index i with null and dec_ref it.

val add_cap : S.attachments -> cap -> int

add_cap t cap stores cap in t. t must have been created by builder. Increases the ref-count on cap by one.

val release_caps : S.attachments -> unit

release_caps a decreases the ref-count of every capability in a.

+Attachments (capnp-rpc.Capnp_rpc_proto.CapTP.Make.EP.Core_types.Attachments)

Module Core_types.Attachments

val builder : unit -> S.attachments

builder () is a fresh writable attachments array.

val cap : int -> S.attachments -> cap

cap i t is the capability at index i in t. The reference count is increased by one.

val clear_cap : S.attachments -> int -> unit

Replace cap at index i with null and dec_ref it.

val add_cap : S.attachments -> cap -> int

add_cap t cap stores cap in t. t must have been created by builder. Increases the ref-count on cap by one.

val release_caps : S.attachments -> unit

release_caps a decreases the ref-count of every capability in a.

diff --git a/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Core_types/Request_payload/index.html b/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Core_types/Request_payload/index.html index f8e5f0a3..f03e10a5 100644 --- a/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Core_types/Request_payload/index.html +++ b/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Core_types/Request_payload/index.html @@ -1,2 +1,2 @@ -Request_payload (capnp-rpc.Capnp_rpc_proto.CapTP.Make.EP.Core_types.Request_payload)

Module Core_types.Request_payload

The payload of a request message.

Wraps WIRE_PAYLOAD to deal with caps rather than attachments.

val snapshot_caps : t -> cap RO_array.t
val field : t -> Wire.Path.t -> cap option

field t path looks up path in the message and returns the capability at that index. Returns None if the field wasn't set. Returns a broken capability if an index was given but does not exist (i.e. the message is corrupted). Increases the ref-count on the result.

val with_caps : cap RO_array.t -> t -> t

with_caps caps t is a copy of t with a new set of capabilities. This is useful to implement TakeFromOtherQuestion, where the message is the same but embargoes may be needed, and to break cycles.

val release : t -> unit

release t frees all the capabilities attached to this message. It is safe to call this multiple times; only the first call has any effect.

val pp : t Fmt.t
+Request_payload (capnp-rpc.Capnp_rpc_proto.CapTP.Make.EP.Core_types.Request_payload)

Module Core_types.Request_payload

The payload of a request message.

Wraps WIRE_PAYLOAD to deal with caps rather than attachments.

val snapshot_caps : t -> cap RO_array.t
val field : t -> Wire.Path.t -> cap option

field t path looks up path in the message and returns the capability at that index. Returns None if the field wasn't set. Returns a broken capability if an index was given but does not exist (i.e. the message is corrupted). Increases the ref-count on the result.

val with_caps : cap RO_array.t -> t -> t

with_caps caps t is a copy of t with a new set of capabilities. This is useful to implement TakeFromOtherQuestion, where the message is the same but embargoes may be needed, and to break cycles.

val release : t -> unit

release t frees all the capabilities attached to this message. It is safe to call this multiple times; only the first call has any effect.

val pp : t Fmt.t
diff --git a/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Core_types/Response_payload/index.html b/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Core_types/Response_payload/index.html index 2a125792..163d709a 100644 --- a/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Core_types/Response_payload/index.html +++ b/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Core_types/Response_payload/index.html @@ -1,2 +1,2 @@ -Response_payload (capnp-rpc.Capnp_rpc_proto.CapTP.Make.EP.Core_types.Response_payload)

Module Core_types.Response_payload

The payload of a response message.

Wraps WIRE_PAYLOAD to deal with caps rather than attachments.

val snapshot_caps : t -> cap RO_array.t
val field : t -> Wire.Path.t -> cap option

field t path looks up path in the message and returns the capability at that index. Returns None if the field wasn't set. Returns a broken capability if an index was given but does not exist (i.e. the message is corrupted). Increases the ref-count on the result.

val with_caps : cap RO_array.t -> t -> t

with_caps caps t is a copy of t with a new set of capabilities. This is useful to implement TakeFromOtherQuestion, where the message is the same but embargoes may be needed, and to break cycles.

val release : t -> unit

release t frees all the capabilities attached to this message. It is safe to call this multiple times; only the first call has any effect.

val pp : t Fmt.t
+Response_payload (capnp-rpc.Capnp_rpc_proto.CapTP.Make.EP.Core_types.Response_payload)

Module Core_types.Response_payload

The payload of a response message.

Wraps WIRE_PAYLOAD to deal with caps rather than attachments.

val snapshot_caps : t -> cap RO_array.t
val field : t -> Wire.Path.t -> cap option

field t path looks up path in the message and returns the capability at that index. Returns None if the field wasn't set. Returns a broken capability if an index was given but does not exist (i.e. the message is corrupted). Increases the ref-count on the result.

val with_caps : cap RO_array.t -> t -> t

with_caps caps t is a copy of t with a new set of capabilities. This is useful to implement TakeFromOtherQuestion, where the message is the same but embargoes may be needed, and to break cycles.

val release : t -> unit

release t frees all the capabilities attached to this message. It is safe to call this multiple times; only the first call has any effect.

val pp : t Fmt.t
diff --git a/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Core_types/Wire/Path/index.html b/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Core_types/Wire/Path/index.html index c2b7e601..d86238d3 100644 --- a/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Core_types/Wire/Path/index.html +++ b/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Core_types/Wire/Path/index.html @@ -1,2 +1,2 @@ -Path (capnp-rpc.Capnp_rpc_proto.CapTP.Make.EP.Core_types.Wire.Path)

Module Wire.Path

A field in a message that refers to a capability.

include Stdlib.Map.OrderedType
type t
val compare : t -> t -> int
val root : t

The path for the bootstrap capability in the bootstrap message.

val pp : t Fmt.t
+Path (capnp-rpc.Capnp_rpc_proto.CapTP.Make.EP.Core_types.Wire.Path)

Module Wire.Path

A field in a message that refers to a capability.

include Stdlib.Map.OrderedType
type t
val compare : t -> t -> int
val root : t

The path for the bootstrap capability in the bootstrap message.

val pp : t Fmt.t
diff --git a/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Core_types/Wire/Request/index.html b/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Core_types/Wire/Request/index.html index 2f51aa93..45f4c528 100644 --- a/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Core_types/Wire/Request/index.html +++ b/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Core_types/Wire/Request/index.html @@ -1,2 +1,2 @@ -Request (capnp-rpc.Capnp_rpc_proto.CapTP.Make.EP.Core_types.Wire.Request)

Module Wire.Request

type t = request msg

A message payload. This is typically a byte array of some kind, plus a way of attaching capabilities.

val pp : t Fmt.t
val cap_index : t -> Path.t -> int option

cap_index msg path is the capability index at path in the message (i.e the index of the capability in the attachments table).

val attachments : t -> S.attachments
val with_attachments : S.attachments -> t -> t
+Request (capnp-rpc.Capnp_rpc_proto.CapTP.Make.EP.Core_types.Wire.Request)

Module Wire.Request

type t = request msg

A message payload. This is typically a byte array of some kind, plus a way of attaching capabilities.

val pp : t Fmt.t
val cap_index : t -> Path.t -> int option

cap_index msg path is the capability index at path in the message (i.e the index of the capability in the attachments table).

val attachments : t -> S.attachments
val with_attachments : S.attachments -> t -> t
diff --git a/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Core_types/Wire/Response/index.html b/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Core_types/Wire/Response/index.html index 7d92a9e4..b45e1329 100644 --- a/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Core_types/Wire/Response/index.html +++ b/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Core_types/Wire/Response/index.html @@ -1,2 +1,2 @@ -Response (capnp-rpc.Capnp_rpc_proto.CapTP.Make.EP.Core_types.Wire.Response)

Module Wire.Response

include S.WIRE_PAYLOAD with type t = response msg and type path := Path.t
type t = response msg

A message payload. This is typically a byte array of some kind, plus a way of attaching capabilities.

val pp : t Fmt.t
val cap_index : t -> Path.t -> int option

cap_index msg path is the capability index at path in the message (i.e the index of the capability in the attachments table).

val attachments : t -> S.attachments
val with_attachments : S.attachments -> t -> t
val bootstrap : unit -> t

The (empty) content for the reply to the bootstrap message.

+Response (capnp-rpc.Capnp_rpc_proto.CapTP.Make.EP.Core_types.Wire.Response)

Module Wire.Response

include S.WIRE_PAYLOAD with type t = response msg and type path := Path.t
type t = response msg

A message payload. This is typically a byte array of some kind, plus a way of attaching capabilities.

val pp : t Fmt.t
val cap_index : t -> Path.t -> int option

cap_index msg path is the capability index at path in the message (i.e the index of the capability in the attachments table).

val attachments : t -> S.attachments
val with_attachments : S.attachments -> t -> t
val bootstrap : unit -> t

The (empty) content for the reply to the bootstrap message.

diff --git a/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Core_types/Wire/index.html b/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Core_types/Wire/index.html index 0ea39d3f..bbd9beb6 100644 --- a/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Core_types/Wire/index.html +++ b/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Core_types/Wire/index.html @@ -1,3 +1,3 @@ -Wire (capnp-rpc.Capnp_rpc_proto.CapTP.Make.EP.Core_types.Wire)

Module Core_types.Wire

The core RPC logic can be used with different serialisation systems. The appropriate types should be provided here.

type request
type response
type 'a msg
module Path : sig ... end

A field in a message that refers to a capability.

module Request : +Wire (capnp-rpc.Capnp_rpc_proto.CapTP.Make.EP.Core_types.Wire)

Module Core_types.Wire

The core RPC logic can be used with different serialisation systems. The appropriate types should be provided here.

type request
type response
type 'a msg
module Path : sig ... end

A field in a message that refers to a capability.

module Request : S.WIRE_PAYLOAD with type t = request msg and type path := Path.t
module Response : sig ... end
val ref_leak_detected : int -> (unit -> unit) -> unit

ref_leak_detected thread_id fn is called when a promise or capability is GC'd while its ref-count is non-zero, indicating that resources may have been leaked. fn () will log a warning about this and free the resources itself. The reason for going via ref_leak_detected rather than calling fn directly is because the OCaml GC may detect the problem at any point (e.g. while we're sending another message). The implementation should arrange for fn to be called at a safe point in thread thread_id (e.g. when returning to the thread's main loop). Unit-tests may wish to call fn immediately to show the error and then fail the test.

diff --git a/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Core_types/class-ref_counted/index.html b/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Core_types/class-ref_counted/index.html index 580c0198..52ec047a 100644 --- a/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Core_types/class-ref_counted/index.html +++ b/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Core_types/class-ref_counted/index.html @@ -1,2 +1,2 @@ -ref_counted (capnp-rpc.Capnp_rpc_proto.CapTP.Make.EP.Core_types.ref_counted)

Class Core_types.ref_counted

A mix-in to help with writing reference-counted objects. It will call self#release when the ref-count reaches zero.

method private virtual release : unit
method virtual pp : Stdlib.Format.formatter -> unit
method private pp_refcount : Stdlib.Format.formatter -> unit

Write the current ref-count to the formatter (use with "%t").

method private check_refcount : unit

Raise an exception if the ref-count is less than one (i.e. check that the object hasn't already been freed).

method update_rc : int -> unit
method check_invariants : unit
method virtual blocker : base_ref option
method sealed_dispatch : 'a. 'a Capnp_rpc_proto__.S.brand -> 'a option
+ref_counted (capnp-rpc.Capnp_rpc_proto.CapTP.Make.EP.Core_types.ref_counted)

Class Core_types.ref_counted

A mix-in to help with writing reference-counted objects. It will call self#release when the ref-count reaches zero.

method private virtual release : unit
method virtual pp : Stdlib.Format.formatter -> unit
method private pp_refcount : Stdlib.Format.formatter -> unit

Write the current ref-count to the formatter (use with "%t").

method private check_refcount : unit

Raise an exception if the ref-count is less than one (i.e. check that the object hasn't already been freed).

method update_rc : int -> unit
method check_invariants : unit
method virtual blocker : base_ref option
method sealed_dispatch : 'a. 'a Capnp_rpc_proto__.S.brand -> 'a option
diff --git a/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Core_types/class-service/index.html b/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Core_types/class-service/index.html index 23b7d6b4..7da6504b 100644 --- a/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Core_types/class-service/index.html +++ b/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Core_types/class-service/index.html @@ -1,2 +1,2 @@ -service (capnp-rpc.Capnp_rpc_proto.CapTP.Make.EP.Core_types.service)

Class Core_types.service

A convenience base class for creating local services. The capability is always resolved, and the default release method does nothing.

inherit base_ref
inherit ref_counted
method virtual call : struct_resolver -> Wire.Request.t -> unit
method shortest : cap
method private release : unit
method when_more_resolved : (cap -> unit) -> unit
method when_released : (unit -> unit) -> unit
method problem : Capnp_rpc_proto__.Exception.t option
+service (capnp-rpc.Capnp_rpc_proto.CapTP.Make.EP.Core_types.service)

Class Core_types.service

A convenience base class for creating local services. The capability is always resolved, and the default release method does nothing.

inherit base_ref
inherit ref_counted
method virtual call : struct_resolver -> Wire.Request.t -> unit
method shortest : cap
method private release : unit
method when_more_resolved : (cap -> unit) -> unit
method when_released : (unit -> unit) -> unit
method problem : Capnp_rpc_proto__.Exception.t option
diff --git a/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Core_types/class-type-base_ref/index.html b/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Core_types/class-type-base_ref/index.html index f758cde3..292ffdb6 100644 --- a/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Core_types/class-type-base_ref/index.html +++ b/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Core_types/class-type-base_ref/index.html @@ -1,2 +1,2 @@ -base_ref (capnp-rpc.Capnp_rpc_proto.CapTP.Make.EP.Core_types.base_ref)

Class type Core_types.base_ref

Common methods for struct_ref and cap.

method pp : Stdlib.Format.formatter -> unit
method update_rc : int -> unit

c#update_rc d adds d to c's (local) reference count. When it reaches zero, c must not be used again. A message may be sent releasing any remote resources.

method blocker : base_ref option

c#blocker is the unresolved cap or struct_ref promise that must resolve for c to resolve. This is used to help detect cycles.

method check_invariants : unit

This is for debugging. Checks its own invariants and those of other base_refs it holds. Raises Invariant_broken if there is a problem.

method sealed_dispatch : 'a. 'a Capnp_rpc_proto__.S.brand -> 'a option

c#sealed_dispatch brand extracts some private data of the given type.

+base_ref (capnp-rpc.Capnp_rpc_proto.CapTP.Make.EP.Core_types.base_ref)

Class type Core_types.base_ref

Common methods for struct_ref and cap.

method pp : Stdlib.Format.formatter -> unit
method update_rc : int -> unit

c#update_rc d adds d to c's (local) reference count. When it reaches zero, c must not be used again. A message may be sent releasing any remote resources.

method blocker : base_ref option

c#blocker is the unresolved cap or struct_ref promise that must resolve for c to resolve. This is used to help detect cycles.

method check_invariants : unit

This is for debugging. Checks its own invariants and those of other base_refs it holds. Raises Invariant_broken if there is a problem.

method sealed_dispatch : 'a. 'a Capnp_rpc_proto__.S.brand -> 'a option

c#sealed_dispatch brand extracts some private data of the given type.

diff --git a/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Core_types/class-type-cap/index.html b/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Core_types/class-type-cap/index.html index 714582f9..2e8a10af 100644 --- a/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Core_types/class-type-cap/index.html +++ b/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Core_types/class-type-cap/index.html @@ -1,2 +1,2 @@ -cap (capnp-rpc.Capnp_rpc_proto.CapTP.Make.EP.Core_types.cap)

Class type Core_types.cap

A 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.

inherit base_ref
method call : struct_resolver -> Wire.Request.t -> unit

c#call results msg invokes a method on c's target and eventually resolves results with the answer.

method shortest : cap

c#shortest is the shortest known path to cap. i.e. if c is forwarding to another cap, we return that, recursively.

method when_more_resolved : (cap -> unit) -> unit

c#when_more_resolved fn calls fn x when this cap becomes more resolved. fn x gets a reference to x and needs to dec_ref it. Note that the new capability can be another promise. If c is already resolved to its final value, this does nothing. If c is a far-ref, fn x will be called when it breaks. If c is forwarding to another cap, it will forward this call. If c gets released before calling fn, it will never call it.

method when_released : (unit -> unit) -> unit

c#when_released fn will call fn () when c's ref-count drops to zero. This is used for caches, to remove entries when they become invalid. For promises, fn will be transferred to the resolution if resolved. For broken caps, this method does nothing (exceptions are never released).

method problem : Capnp_rpc_proto__.Exception.t option

c#problem is the exception for a broken reference, or None if it is not known to be broken.

+cap (capnp-rpc.Capnp_rpc_proto.CapTP.Make.EP.Core_types.cap)

Class type Core_types.cap

A 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.

inherit base_ref
method call : struct_resolver -> Wire.Request.t -> unit

c#call results msg invokes a method on c's target and eventually resolves results with the answer.

method shortest : cap

c#shortest is the shortest known path to cap. i.e. if c is forwarding to another cap, we return that, recursively.

method when_more_resolved : (cap -> unit) -> unit

c#when_more_resolved fn calls fn x when this cap becomes more resolved. fn x gets a reference to x and needs to dec_ref it. Note that the new capability can be another promise. If c is already resolved to its final value, this does nothing. If c is a far-ref, fn x will be called when it breaks. If c is forwarding to another cap, it will forward this call. If c gets released before calling fn, it will never call it.

method when_released : (unit -> unit) -> unit

c#when_released fn will call fn () when c's ref-count drops to zero. This is used for caches, to remove entries when they become invalid. For promises, fn will be transferred to the resolution if resolved. For broken caps, this method does nothing (exceptions are never released).

method problem : Capnp_rpc_proto__.Exception.t option

c#problem is the exception for a broken reference, or None if it is not known to be broken.

diff --git a/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Core_types/class-type-struct_ref/index.html b/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Core_types/class-type-struct_ref/index.html index 5a9719fd..b08c5ae9 100644 --- a/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Core_types/class-type-struct_ref/index.html +++ b/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Core_types/class-type-struct_ref/index.html @@ -1,2 +1,2 @@ -struct_ref (capnp-rpc.Capnp_rpc_proto.CapTP.Make.EP.Core_types.struct_ref)

Class type Core_types.struct_ref

The 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.

inherit base_ref
method when_resolved : (Wire.Response.t or_error -> unit) -> unit

r#when_resolved fn queues up fn to be called on the result, when it arrives. If the result has already arrived, fn is called immediately.

method response : Wire.Response.t or_error option

r#response is Some payload if the response has arrived, or None if we're still waiting.

method cap : Wire.Path.t -> cap

r#cap path is the capability found at path in the response. If the response has arrived, this will extract the capability from it. If not, it may create a capability that will pipeline through the promised answer until the result arrives (at which point it will use the new, more direct route). The caller should call cap#dec_ref when done.

+struct_ref (capnp-rpc.Capnp_rpc_proto.CapTP.Make.EP.Core_types.struct_ref)

Class type Core_types.struct_ref

The 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.

inherit base_ref
method when_resolved : (Wire.Response.t or_error -> unit) -> unit

r#when_resolved fn queues up fn to be called on the result, when it arrives. If the result has already arrived, fn is called immediately.

method response : Wire.Response.t or_error option

r#response is Some payload if the response has arrived, or None if we're still waiting.

method cap : Wire.Path.t -> cap

r#cap path is the capability found at path in the response. If the response has arrived, this will extract the capability from it. If not, it may create a capability that will pipeline through the promised answer until the result arrives (at which point it will use the new, more direct route). The caller should call cap#dec_ref when done.

diff --git a/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Core_types/class-type-struct_resolver/index.html b/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Core_types/class-type-struct_resolver/index.html index 87c48175..f2b5edd3 100644 --- a/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Core_types/class-type-struct_resolver/index.html +++ b/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Core_types/class-type-struct_resolver/index.html @@ -1,2 +1,2 @@ -struct_resolver (capnp-rpc.Capnp_rpc_proto.CapTP.Make.EP.Core_types.struct_resolver)

Class type Core_types.struct_resolver

A struct_resolver can be used to resolve some promise.

method pp : Stdlib.Format.formatter -> unit
method resolve : struct_ref -> unit

r#resolve x causes r's promise to behave as x in future. The promise takes ownership of x (is responsible for calling dec_rec on it).

method sealed_dispatch : 'a. 'a Capnp_rpc_proto__.S.brand -> 'a option

r#sealed_dispatch brand extracts some private data of the given type.

method set_blocker : base_ref -> (unit, [> `Cycle ]) Stdlib.result

r#set_blocker b means that resolve won't be called until b is resolved. r's promise should report this as its blocker. This is needed to detect cycles. When the blocker is resolved, call this again with None to clear it (the promise will then report itself as the blocker again, until resolved).

method clear_blocker : unit

r#clear_blocker removes the blocker set by set_blocker. r is then blocked by itself, if unresolved.

+struct_resolver (capnp-rpc.Capnp_rpc_proto.CapTP.Make.EP.Core_types.struct_resolver)

Class type Core_types.struct_resolver

A struct_resolver can be used to resolve some promise.

method pp : Stdlib.Format.formatter -> unit
method resolve : struct_ref -> unit

r#resolve x causes r's promise to behave as x in future. The promise takes ownership of x (is responsible for calling dec_rec on it).

method sealed_dispatch : 'a. 'a Capnp_rpc_proto__.S.brand -> 'a option

r#sealed_dispatch brand extracts some private data of the given type.

method set_blocker : base_ref -> (unit, [> `Cycle ]) Stdlib.result

r#set_blocker b means that resolve won't be called until b is resolved. r's promise should report this as its blocker. This is needed to detect cycles. When the blocker is resolved, call this again with None to clear it (the promise will then report itself as the blocker again, until resolved).

method clear_blocker : unit

r#clear_blocker removes the blocker set by set_blocker. r is then blocked by itself, if unresolved.

diff --git a/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Core_types/index.html b/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Core_types/index.html index b28b8609..48a0814e 100644 --- a/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Core_types/index.html +++ b/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Core_types/index.html @@ -1,5 +1,5 @@ -Core_types (capnp-rpc.Capnp_rpc_proto.CapTP.Make.EP.Core_types)

Module EP.Core_types

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.

module Wire : S.WIRE

The core RPC logic can be used with different serialisation systems. The appropriate types should be provided here.

type 'a or_error = ('a, Error.t) Stdlib.result
class type base_ref = object ... end

Common methods for struct_ref and cap.

val pp : base_ref Fmt.t
val inc_ref : base_ref -> unit

inc_ref x increases x's ref-count by one.

val dec_ref : base_ref -> unit

dec_ref x decreases x's ref-count by one.

class type struct_ref = object ... end

The 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 ... end

A 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 ... end

A struct_resolver can be used to resolve some promise.

module Attachments : sig ... end
module Request_payload : +Core_types (capnp-rpc.Capnp_rpc_proto.CapTP.Make.EP.Core_types)

Module EP.Core_types

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.

module Wire : S.WIRE

The core RPC logic can be used with different serialisation systems. The appropriate types should be provided here.

type 'a or_error = ('a, Error.t) Stdlib.result
class type base_ref = object ... end

Common methods for struct_ref and cap.

val pp : base_ref Fmt.t
val inc_ref : base_ref -> unit

inc_ref x increases x's ref-count by one.

val dec_ref : base_ref -> unit

dec_ref x decreases x's ref-count by one.

class type struct_ref = object ... end

The 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 ... end

A 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 ... end

A struct_resolver can be used to resolve some promise.

module Attachments : sig ... end
module Request_payload : S.PAYLOAD with type t = Wire.Request.t and type cap := cap diff --git a/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/In/AnswerId/index.html b/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/In/AnswerId/index.html index 0a8ad699..b1f8b95d 100644 --- a/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/In/AnswerId/index.html +++ b/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/In/AnswerId/index.html @@ -1,2 +1,2 @@ -AnswerId (capnp-rpc.Capnp_rpc_proto.CapTP.Make.EP.In.AnswerId)

Module In.AnswerId

val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
+AnswerId (capnp-rpc.Capnp_rpc_proto.CapTP.Make.EP.In.AnswerId)

Module In.AnswerId

val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
diff --git a/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/In/ExportId/index.html b/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/In/ExportId/index.html index 37e3c679..9c80f7c8 100644 --- a/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/In/ExportId/index.html +++ b/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/In/ExportId/index.html @@ -1,2 +1,2 @@ -ExportId (capnp-rpc.Capnp_rpc_proto.CapTP.Make.EP.In.ExportId)

Module In.ExportId

val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
+ExportId (capnp-rpc.Capnp_rpc_proto.CapTP.Make.EP.In.ExportId)

Module In.ExportId

val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
diff --git a/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/In/ImportId/index.html b/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/In/ImportId/index.html index 5e043828..62dff06e 100644 --- a/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/In/ImportId/index.html +++ b/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/In/ImportId/index.html @@ -1,2 +1,2 @@ -ImportId (capnp-rpc.Capnp_rpc_proto.CapTP.Make.EP.In.ImportId)

Module In.ImportId

val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
+ImportId (capnp-rpc.Capnp_rpc_proto.CapTP.Make.EP.In.ImportId)

Module In.ImportId

val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
diff --git a/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/In/QuestionId/index.html b/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/In/QuestionId/index.html index 7be9e126..b3b2008d 100644 --- a/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/In/QuestionId/index.html +++ b/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/In/QuestionId/index.html @@ -1,2 +1,2 @@ -QuestionId (capnp-rpc.Capnp_rpc_proto.CapTP.Make.EP.In.QuestionId)

Module In.QuestionId

val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
+QuestionId (capnp-rpc.Capnp_rpc_proto.CapTP.Make.EP.In.QuestionId)

Module In.QuestionId

val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
diff --git a/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/In/index.html b/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/In/index.html index da590e59..3d0b06d8 100644 --- a/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/In/index.html +++ b/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/In/index.html @@ -1,5 +1,5 @@ -In (capnp-rpc.Capnp_rpc_proto.CapTP.Make.EP.In)

Module EP.In

The type of messages received by this endpoint.

module QuestionId : sig ... end
module AnswerId : sig ... end
module ImportId : sig ... end
module ExportId : sig ... end
type message_target = [
  1. | `ReceiverAnswer of QuestionId.t * Core_types.Wire.Path.t
  2. | `ReceiverHosted of ImportId.t
]
type desc = [
  1. | `None
  2. | `ReceiverAnswer of QuestionId.t * Core_types.Wire.Path.t
  3. | `ReceiverHosted of ImportId.t
  4. | `SenderHosted of ExportId.t
  5. | `SenderPromise of ExportId.t
  6. | `ThirdPartyHosted of third_party_desc
]
val pp_desc : +In (capnp-rpc.Capnp_rpc_proto.CapTP.Make.EP.In)

Module EP.In

The type of messages received by this endpoint.

module QuestionId : sig ... end
module AnswerId : sig ... end
module ImportId : sig ... end
module ExportId : sig ... end
type message_target = [
  1. | `ReceiverAnswer of QuestionId.t * Core_types.Wire.Path.t
  2. | `ReceiverHosted of ImportId.t
]
type desc = [
  1. | `None
  2. | `ReceiverAnswer of QuestionId.t * Core_types.Wire.Path.t
  3. | `ReceiverHosted of ImportId.t
  4. | `SenderHosted of ExportId.t
  5. | `SenderPromise of ExportId.t
  6. | `ThirdPartyHosted of third_party_desc
]
val pp_desc : Stdlib.Format.formatter -> [< `Local of < pp : Stdlib.Format.formatter -> unit.. > | `None diff --git a/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Network_types/index.html b/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Network_types/index.html index d65bc72f..377669bb 100644 --- a/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Network_types/index.html +++ b/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Network_types/index.html @@ -1,2 +1,2 @@ -Network_types (capnp-rpc.Capnp_rpc_proto.CapTP.Make.EP.Network_types)

Module EP.Network_types

type provision_id
type recipient_id
type third_party_cap_id
type join_key_part
+Network_types (capnp-rpc.Capnp_rpc_proto.CapTP.Make.EP.Network_types)

Module EP.Network_types

type provision_id
type recipient_id
type third_party_cap_id
type join_key_part
diff --git a/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Out/AnswerId/index.html b/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Out/AnswerId/index.html index 956cb24d..575f65e8 100644 --- a/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Out/AnswerId/index.html +++ b/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Out/AnswerId/index.html @@ -1,2 +1,2 @@ -AnswerId (capnp-rpc.Capnp_rpc_proto.CapTP.Make.EP.Out.AnswerId)

Module Out.AnswerId

val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
+AnswerId (capnp-rpc.Capnp_rpc_proto.CapTP.Make.EP.Out.AnswerId)

Module Out.AnswerId

val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
diff --git a/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Out/ExportId/index.html b/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Out/ExportId/index.html index 1c57463c..c3091f4c 100644 --- a/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Out/ExportId/index.html +++ b/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Out/ExportId/index.html @@ -1,2 +1,2 @@ -ExportId (capnp-rpc.Capnp_rpc_proto.CapTP.Make.EP.Out.ExportId)

Module Out.ExportId

val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
+ExportId (capnp-rpc.Capnp_rpc_proto.CapTP.Make.EP.Out.ExportId)

Module Out.ExportId

val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
diff --git a/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Out/ImportId/index.html b/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Out/ImportId/index.html index de94e666..407710a9 100644 --- a/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Out/ImportId/index.html +++ b/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Out/ImportId/index.html @@ -1,2 +1,2 @@ -ImportId (capnp-rpc.Capnp_rpc_proto.CapTP.Make.EP.Out.ImportId)

Module Out.ImportId

val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
+ImportId (capnp-rpc.Capnp_rpc_proto.CapTP.Make.EP.Out.ImportId)

Module Out.ImportId

val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
diff --git a/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Out/QuestionId/index.html b/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Out/QuestionId/index.html index 4a165677..efe29add 100644 --- a/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Out/QuestionId/index.html +++ b/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Out/QuestionId/index.html @@ -1,2 +1,2 @@ -QuestionId (capnp-rpc.Capnp_rpc_proto.CapTP.Make.EP.Out.QuestionId)

Module Out.QuestionId

val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
+QuestionId (capnp-rpc.Capnp_rpc_proto.CapTP.Make.EP.Out.QuestionId)

Module Out.QuestionId

val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
diff --git a/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Out/index.html b/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Out/index.html index f6452c13..994e088e 100644 --- a/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Out/index.html +++ b/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Out/index.html @@ -1,5 +1,5 @@ -Out (capnp-rpc.Capnp_rpc_proto.CapTP.Make.EP.Out)

Module EP.Out

The type of messages sent by this endpoint.

module QuestionId : sig ... end
module AnswerId : sig ... end
module ImportId : sig ... end
module ExportId : sig ... end
type message_target = [
  1. | `ReceiverAnswer of QuestionId.t * Core_types.Wire.Path.t
  2. | `ReceiverHosted of ImportId.t
]
type desc = [
  1. | `None
  2. | `ReceiverAnswer of QuestionId.t * Core_types.Wire.Path.t
  3. | `ReceiverHosted of ImportId.t
  4. | `SenderHosted of ExportId.t
  5. | `SenderPromise of ExportId.t
  6. | `ThirdPartyHosted of third_party_desc
]
val pp_desc : +Out (capnp-rpc.Capnp_rpc_proto.CapTP.Make.EP.Out)

Module EP.Out

The type of messages sent by this endpoint.

module QuestionId : sig ... end
module AnswerId : sig ... end
module ImportId : sig ... end
module ExportId : sig ... end
type message_target = [
  1. | `ReceiverAnswer of QuestionId.t * Core_types.Wire.Path.t
  2. | `ReceiverHosted of ImportId.t
]
type desc = [
  1. | `None
  2. | `ReceiverAnswer of QuestionId.t * Core_types.Wire.Path.t
  3. | `ReceiverHosted of ImportId.t
  4. | `SenderHosted of ExportId.t
  5. | `SenderPromise of ExportId.t
  6. | `ThirdPartyHosted of third_party_desc
]
val pp_desc : Stdlib.Format.formatter -> [< `Local of < pp : Stdlib.Format.formatter -> unit.. > | `None diff --git a/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Table/AnswerId/index.html b/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Table/AnswerId/index.html index 29fd6fc4..d324e2c3 100644 --- a/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Table/AnswerId/index.html +++ b/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Table/AnswerId/index.html @@ -1,2 +1,2 @@ -AnswerId (capnp-rpc.Capnp_rpc_proto.CapTP.Make.EP.Table.AnswerId)

Module Table.AnswerId

type t = private Stdint.Uint32.t
val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
+AnswerId (capnp-rpc.Capnp_rpc_proto.CapTP.Make.EP.Table.AnswerId)

Module Table.AnswerId

type t = private Stdint.Uint32.t
val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
diff --git a/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Table/ExportId/index.html b/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Table/ExportId/index.html index adf551fd..19631aae 100644 --- a/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Table/ExportId/index.html +++ b/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Table/ExportId/index.html @@ -1,2 +1,2 @@ -ExportId (capnp-rpc.Capnp_rpc_proto.CapTP.Make.EP.Table.ExportId)

Module Table.ExportId

type t = private Stdint.Uint32.t
val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
+ExportId (capnp-rpc.Capnp_rpc_proto.CapTP.Make.EP.Table.ExportId)

Module Table.ExportId

type t = private Stdint.Uint32.t
val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
diff --git a/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Table/ImportId/index.html b/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Table/ImportId/index.html index 1d241115..d72d7c54 100644 --- a/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Table/ImportId/index.html +++ b/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Table/ImportId/index.html @@ -1,2 +1,2 @@ -ImportId (capnp-rpc.Capnp_rpc_proto.CapTP.Make.EP.Table.ImportId)

Module Table.ImportId

type t = private Stdint.Uint32.t
val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
+ImportId (capnp-rpc.Capnp_rpc_proto.CapTP.Make.EP.Table.ImportId)

Module Table.ImportId

type t = private Stdint.Uint32.t
val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
diff --git a/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Table/QuestionId/index.html b/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Table/QuestionId/index.html index 1ecfcb1f..961ff556 100644 --- a/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Table/QuestionId/index.html +++ b/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Table/QuestionId/index.html @@ -1,2 +1,2 @@ -QuestionId (capnp-rpc.Capnp_rpc_proto.CapTP.Make.EP.Table.QuestionId)

Module Table.QuestionId

type t = private Stdint.Uint32.t
val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
+QuestionId (capnp-rpc.Capnp_rpc_proto.CapTP.Make.EP.Table.QuestionId)

Module Table.QuestionId

type t = private Stdint.Uint32.t
val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
diff --git a/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Table/index.html b/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Table/index.html index 30a8a58e..8c913970 100644 --- a/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Table/index.html +++ b/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/Table/index.html @@ -1,2 +1,2 @@ -Table (capnp-rpc.Capnp_rpc_proto.CapTP.Make.EP.Table)

Module EP.Table

For the unit tests it is convenient to pass in the types of table indexes. This allows the tests to make both ends of a connection, with the types matched up.

module QuestionId : Id.S
module AnswerId : Id.S
module ImportId : Id.S
module ExportId : Id.S
+Table (capnp-rpc.Capnp_rpc_proto.CapTP.Make.EP.Table)

Module EP.Table

For the unit tests it is convenient to pass in the types of table indexes. This allows the tests to make both ends of a connection, with the types matched up.

module QuestionId : Id.S
module AnswerId : Id.S
module ImportId : Id.S
module ExportId : Id.S
diff --git a/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/index.html b/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/index.html index 78850759..33020e8c 100644 --- a/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/index.html +++ b/capnp-rpc/Capnp_rpc_proto/CapTP/Make/argument-1-EP/index.html @@ -1,2 +1,2 @@ -EP (capnp-rpc.Capnp_rpc_proto.CapTP.Make.EP)

Parameter Make.EP

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.

For the unit tests it is convenient to pass in the types of table indexes. This allows the tests to make both ends of a connection, with the types matched up.

module Out : sig ... end

The type of messages sent by this endpoint.

module In : sig ... end

The type of messages received by this endpoint.

+EP (capnp-rpc.Capnp_rpc_proto.CapTP.Make.EP)

Parameter Make.EP

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.

For the unit tests it is convenient to pass in the types of table indexes. This allows the tests to make both ends of a connection, with the types matched up.

module Out : sig ... end

The type of messages sent by this endpoint.

module In : sig ... end

The type of messages received by this endpoint.

diff --git a/capnp-rpc/Capnp_rpc_proto/CapTP/Make/index.html b/capnp-rpc/Capnp_rpc_proto/CapTP/Make/index.html index 7c9b3954..580a0605 100644 --- a/capnp-rpc/Capnp_rpc_proto/CapTP/Make/index.html +++ b/capnp-rpc/Capnp_rpc_proto/CapTP/Make/index.html @@ -1,5 +1,5 @@ -Make (capnp-rpc.Capnp_rpc_proto.CapTP.Make)

Module CapTP.Make

Parameters

Signature

type t

A t is a connection to a remote vat.

type restorer = +Make (capnp-rpc.Capnp_rpc_proto.CapTP.Make)

Module CapTP.Make

Parameters

Signature

type t

A t is a connection to a remote vat.

type restorer = ((EP.Core_types.cap, Exception.t) Stdlib.result -> unit) -> string -> unit

A restorer is a function f for restoring saved capabilities. f k object_id must eventually call k result exactly once to respond to the client's bootstrap message with result. k takes ownership of the capability.

val create : diff --git a/capnp-rpc/Capnp_rpc_proto/CapTP/index.html b/capnp-rpc/Capnp_rpc_proto/CapTP/index.html index 5b37bdb9..01852846 100644 --- a/capnp-rpc/Capnp_rpc_proto/CapTP/index.html +++ b/capnp-rpc/Capnp_rpc_proto/CapTP/index.html @@ -1,2 +1,2 @@ -CapTP (capnp-rpc.Capnp_rpc_proto.CapTP)

Module Capnp_rpc_proto.CapTP

The abstract Cap'n Proto RPC network protocol.

module Make (EP : Message_types.ENDPOINT) : sig ... end
+CapTP (capnp-rpc.Capnp_rpc_proto.CapTP)

Module Capnp_rpc_proto.CapTP

The abstract Cap'n Proto RPC network protocol.

module Make (EP : Message_types.ENDPOINT) : sig ... end
diff --git a/capnp-rpc/Capnp_rpc_proto/Cap_proxy/Make/argument-1-C/Attachments/index.html b/capnp-rpc/Capnp_rpc_proto/Cap_proxy/Make/argument-1-C/Attachments/index.html index 005de152..a5a1284a 100644 --- a/capnp-rpc/Capnp_rpc_proto/Cap_proxy/Make/argument-1-C/Attachments/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Cap_proxy/Make/argument-1-C/Attachments/index.html @@ -1,2 +1,2 @@ -Attachments (capnp-rpc.Capnp_rpc_proto.Cap_proxy.Make.C.Attachments)

Module C.Attachments

val builder : unit -> S.attachments

builder () is a fresh writable attachments array.

val cap : int -> S.attachments -> cap

cap i t is the capability at index i in t. The reference count is increased by one.

val clear_cap : S.attachments -> int -> unit

Replace cap at index i with null and dec_ref it.

val add_cap : S.attachments -> cap -> int

add_cap t cap stores cap in t. t must have been created by builder. Increases the ref-count on cap by one.

val release_caps : S.attachments -> unit

release_caps a decreases the ref-count of every capability in a.

+Attachments (capnp-rpc.Capnp_rpc_proto.Cap_proxy.Make.C.Attachments)

Module C.Attachments

val builder : unit -> S.attachments

builder () is a fresh writable attachments array.

val cap : int -> S.attachments -> cap

cap i t is the capability at index i in t. The reference count is increased by one.

val clear_cap : S.attachments -> int -> unit

Replace cap at index i with null and dec_ref it.

val add_cap : S.attachments -> cap -> int

add_cap t cap stores cap in t. t must have been created by builder. Increases the ref-count on cap by one.

val release_caps : S.attachments -> unit

release_caps a decreases the ref-count of every capability in a.

diff --git a/capnp-rpc/Capnp_rpc_proto/Cap_proxy/Make/argument-1-C/Request_payload/index.html b/capnp-rpc/Capnp_rpc_proto/Cap_proxy/Make/argument-1-C/Request_payload/index.html index 1ea863f5..cc884638 100644 --- a/capnp-rpc/Capnp_rpc_proto/Cap_proxy/Make/argument-1-C/Request_payload/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Cap_proxy/Make/argument-1-C/Request_payload/index.html @@ -1,2 +1,2 @@ -Request_payload (capnp-rpc.Capnp_rpc_proto.Cap_proxy.Make.C.Request_payload)

Module C.Request_payload

The payload of a request message.

Wraps WIRE_PAYLOAD to deal with caps rather than attachments.

val snapshot_caps : t -> cap RO_array.t
val field : t -> Wire.Path.t -> cap option

field t path looks up path in the message and returns the capability at that index. Returns None if the field wasn't set. Returns a broken capability if an index was given but does not exist (i.e. the message is corrupted). Increases the ref-count on the result.

val with_caps : cap RO_array.t -> t -> t

with_caps caps t is a copy of t with a new set of capabilities. This is useful to implement TakeFromOtherQuestion, where the message is the same but embargoes may be needed, and to break cycles.

val release : t -> unit

release t frees all the capabilities attached to this message. It is safe to call this multiple times; only the first call has any effect.

val pp : t Fmt.t
+Request_payload (capnp-rpc.Capnp_rpc_proto.Cap_proxy.Make.C.Request_payload)

Module C.Request_payload

The payload of a request message.

Wraps WIRE_PAYLOAD to deal with caps rather than attachments.

val snapshot_caps : t -> cap RO_array.t
val field : t -> Wire.Path.t -> cap option

field t path looks up path in the message and returns the capability at that index. Returns None if the field wasn't set. Returns a broken capability if an index was given but does not exist (i.e. the message is corrupted). Increases the ref-count on the result.

val with_caps : cap RO_array.t -> t -> t

with_caps caps t is a copy of t with a new set of capabilities. This is useful to implement TakeFromOtherQuestion, where the message is the same but embargoes may be needed, and to break cycles.

val release : t -> unit

release t frees all the capabilities attached to this message. It is safe to call this multiple times; only the first call has any effect.

val pp : t Fmt.t
diff --git a/capnp-rpc/Capnp_rpc_proto/Cap_proxy/Make/argument-1-C/Response_payload/index.html b/capnp-rpc/Capnp_rpc_proto/Cap_proxy/Make/argument-1-C/Response_payload/index.html index f2b975c8..ca771699 100644 --- a/capnp-rpc/Capnp_rpc_proto/Cap_proxy/Make/argument-1-C/Response_payload/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Cap_proxy/Make/argument-1-C/Response_payload/index.html @@ -1,2 +1,2 @@ -Response_payload (capnp-rpc.Capnp_rpc_proto.Cap_proxy.Make.C.Response_payload)

Module C.Response_payload

The payload of a response message.

Wraps WIRE_PAYLOAD to deal with caps rather than attachments.

val snapshot_caps : t -> cap RO_array.t
val field : t -> Wire.Path.t -> cap option

field t path looks up path in the message and returns the capability at that index. Returns None if the field wasn't set. Returns a broken capability if an index was given but does not exist (i.e. the message is corrupted). Increases the ref-count on the result.

val with_caps : cap RO_array.t -> t -> t

with_caps caps t is a copy of t with a new set of capabilities. This is useful to implement TakeFromOtherQuestion, where the message is the same but embargoes may be needed, and to break cycles.

val release : t -> unit

release t frees all the capabilities attached to this message. It is safe to call this multiple times; only the first call has any effect.

val pp : t Fmt.t
+Response_payload (capnp-rpc.Capnp_rpc_proto.Cap_proxy.Make.C.Response_payload)

Module C.Response_payload

The payload of a response message.

Wraps WIRE_PAYLOAD to deal with caps rather than attachments.

val snapshot_caps : t -> cap RO_array.t
val field : t -> Wire.Path.t -> cap option

field t path looks up path in the message and returns the capability at that index. Returns None if the field wasn't set. Returns a broken capability if an index was given but does not exist (i.e. the message is corrupted). Increases the ref-count on the result.

val with_caps : cap RO_array.t -> t -> t

with_caps caps t is a copy of t with a new set of capabilities. This is useful to implement TakeFromOtherQuestion, where the message is the same but embargoes may be needed, and to break cycles.

val release : t -> unit

release t frees all the capabilities attached to this message. It is safe to call this multiple times; only the first call has any effect.

val pp : t Fmt.t
diff --git a/capnp-rpc/Capnp_rpc_proto/Cap_proxy/Make/argument-1-C/Wire/Path/index.html b/capnp-rpc/Capnp_rpc_proto/Cap_proxy/Make/argument-1-C/Wire/Path/index.html index 201ab93b..e494eb7f 100644 --- a/capnp-rpc/Capnp_rpc_proto/Cap_proxy/Make/argument-1-C/Wire/Path/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Cap_proxy/Make/argument-1-C/Wire/Path/index.html @@ -1,2 +1,2 @@ -Path (capnp-rpc.Capnp_rpc_proto.Cap_proxy.Make.C.Wire.Path)

Module Wire.Path

A field in a message that refers to a capability.

include Stdlib.Map.OrderedType
type t
val compare : t -> t -> int
val root : t

The path for the bootstrap capability in the bootstrap message.

val pp : t Fmt.t
+Path (capnp-rpc.Capnp_rpc_proto.Cap_proxy.Make.C.Wire.Path)

Module Wire.Path

A field in a message that refers to a capability.

include Stdlib.Map.OrderedType
type t
val compare : t -> t -> int
val root : t

The path for the bootstrap capability in the bootstrap message.

val pp : t Fmt.t
diff --git a/capnp-rpc/Capnp_rpc_proto/Cap_proxy/Make/argument-1-C/Wire/Request/index.html b/capnp-rpc/Capnp_rpc_proto/Cap_proxy/Make/argument-1-C/Wire/Request/index.html index c7010ed9..918f56ae 100644 --- a/capnp-rpc/Capnp_rpc_proto/Cap_proxy/Make/argument-1-C/Wire/Request/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Cap_proxy/Make/argument-1-C/Wire/Request/index.html @@ -1,2 +1,2 @@ -Request (capnp-rpc.Capnp_rpc_proto.Cap_proxy.Make.C.Wire.Request)

Module Wire.Request

type t = request msg

A message payload. This is typically a byte array of some kind, plus a way of attaching capabilities.

val pp : t Fmt.t
val cap_index : t -> Path.t -> int option

cap_index msg path is the capability index at path in the message (i.e the index of the capability in the attachments table).

val attachments : t -> S.attachments
val with_attachments : S.attachments -> t -> t
+Request (capnp-rpc.Capnp_rpc_proto.Cap_proxy.Make.C.Wire.Request)

Module Wire.Request

type t = request msg

A message payload. This is typically a byte array of some kind, plus a way of attaching capabilities.

val pp : t Fmt.t
val cap_index : t -> Path.t -> int option

cap_index msg path is the capability index at path in the message (i.e the index of the capability in the attachments table).

val attachments : t -> S.attachments
val with_attachments : S.attachments -> t -> t
diff --git a/capnp-rpc/Capnp_rpc_proto/Cap_proxy/Make/argument-1-C/Wire/Response/index.html b/capnp-rpc/Capnp_rpc_proto/Cap_proxy/Make/argument-1-C/Wire/Response/index.html index f74890eb..27dca298 100644 --- a/capnp-rpc/Capnp_rpc_proto/Cap_proxy/Make/argument-1-C/Wire/Response/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Cap_proxy/Make/argument-1-C/Wire/Response/index.html @@ -1,2 +1,2 @@ -Response (capnp-rpc.Capnp_rpc_proto.Cap_proxy.Make.C.Wire.Response)

Module Wire.Response

include S.WIRE_PAYLOAD with type t = response msg and type path := Path.t
type t = response msg

A message payload. This is typically a byte array of some kind, plus a way of attaching capabilities.

val pp : t Fmt.t
val cap_index : t -> Path.t -> int option

cap_index msg path is the capability index at path in the message (i.e the index of the capability in the attachments table).

val attachments : t -> S.attachments
val with_attachments : S.attachments -> t -> t
val bootstrap : unit -> t

The (empty) content for the reply to the bootstrap message.

+Response (capnp-rpc.Capnp_rpc_proto.Cap_proxy.Make.C.Wire.Response)

Module Wire.Response

include S.WIRE_PAYLOAD with type t = response msg and type path := Path.t
type t = response msg

A message payload. This is typically a byte array of some kind, plus a way of attaching capabilities.

val pp : t Fmt.t
val cap_index : t -> Path.t -> int option

cap_index msg path is the capability index at path in the message (i.e the index of the capability in the attachments table).

val attachments : t -> S.attachments
val with_attachments : S.attachments -> t -> t
val bootstrap : unit -> t

The (empty) content for the reply to the bootstrap message.

diff --git a/capnp-rpc/Capnp_rpc_proto/Cap_proxy/Make/argument-1-C/Wire/index.html b/capnp-rpc/Capnp_rpc_proto/Cap_proxy/Make/argument-1-C/Wire/index.html index ef298c71..f7668e2e 100644 --- a/capnp-rpc/Capnp_rpc_proto/Cap_proxy/Make/argument-1-C/Wire/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Cap_proxy/Make/argument-1-C/Wire/index.html @@ -1,3 +1,3 @@ -Wire (capnp-rpc.Capnp_rpc_proto.Cap_proxy.Make.C.Wire)

Module C.Wire

The core RPC logic can be used with different serialisation systems. The appropriate types should be provided here.

type request
type response
type 'a msg
module Path : sig ... end

A field in a message that refers to a capability.

module Request : +Wire (capnp-rpc.Capnp_rpc_proto.Cap_proxy.Make.C.Wire)

Module C.Wire

The core RPC logic can be used with different serialisation systems. The appropriate types should be provided here.

type request
type response
type 'a msg
module Path : sig ... end

A field in a message that refers to a capability.

module Request : S.WIRE_PAYLOAD with type t = request msg and type path := Path.t
module Response : sig ... end
val ref_leak_detected : int -> (unit -> unit) -> unit

ref_leak_detected thread_id fn is called when a promise or capability is GC'd while its ref-count is non-zero, indicating that resources may have been leaked. fn () will log a warning about this and free the resources itself. The reason for going via ref_leak_detected rather than calling fn directly is because the OCaml GC may detect the problem at any point (e.g. while we're sending another message). The implementation should arrange for fn to be called at a safe point in thread thread_id (e.g. when returning to the thread's main loop). Unit-tests may wish to call fn immediately to show the error and then fail the test.

diff --git a/capnp-rpc/Capnp_rpc_proto/Cap_proxy/Make/argument-1-C/class-ref_counted/index.html b/capnp-rpc/Capnp_rpc_proto/Cap_proxy/Make/argument-1-C/class-ref_counted/index.html index 35df6525..e86edbce 100644 --- a/capnp-rpc/Capnp_rpc_proto/Cap_proxy/Make/argument-1-C/class-ref_counted/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Cap_proxy/Make/argument-1-C/class-ref_counted/index.html @@ -1,2 +1,2 @@ -ref_counted (capnp-rpc.Capnp_rpc_proto.Cap_proxy.Make.C.ref_counted)

Class C.ref_counted

A mix-in to help with writing reference-counted objects. It will call self#release when the ref-count reaches zero.

method private virtual release : unit
method virtual pp : Stdlib.Format.formatter -> unit
method private pp_refcount : Stdlib.Format.formatter -> unit

Write the current ref-count to the formatter (use with "%t").

method private check_refcount : unit

Raise an exception if the ref-count is less than one (i.e. check that the object hasn't already been freed).

method update_rc : int -> unit
method check_invariants : unit
method virtual blocker : base_ref option
method sealed_dispatch : 'a. 'a Capnp_rpc_proto__.S.brand -> 'a option
+ref_counted (capnp-rpc.Capnp_rpc_proto.Cap_proxy.Make.C.ref_counted)

Class C.ref_counted

A mix-in to help with writing reference-counted objects. It will call self#release when the ref-count reaches zero.

method private virtual release : unit
method virtual pp : Stdlib.Format.formatter -> unit
method private pp_refcount : Stdlib.Format.formatter -> unit

Write the current ref-count to the formatter (use with "%t").

method private check_refcount : unit

Raise an exception if the ref-count is less than one (i.e. check that the object hasn't already been freed).

method update_rc : int -> unit
method check_invariants : unit
method virtual blocker : base_ref option
method sealed_dispatch : 'a. 'a Capnp_rpc_proto__.S.brand -> 'a option
diff --git a/capnp-rpc/Capnp_rpc_proto/Cap_proxy/Make/argument-1-C/class-service/index.html b/capnp-rpc/Capnp_rpc_proto/Cap_proxy/Make/argument-1-C/class-service/index.html index 52ad6f60..b22540fd 100644 --- a/capnp-rpc/Capnp_rpc_proto/Cap_proxy/Make/argument-1-C/class-service/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Cap_proxy/Make/argument-1-C/class-service/index.html @@ -1,2 +1,2 @@ -service (capnp-rpc.Capnp_rpc_proto.Cap_proxy.Make.C.service)

Class C.service

A convenience base class for creating local services. The capability is always resolved, and the default release method does nothing.

inherit base_ref
inherit ref_counted
method virtual call : struct_resolver -> Wire.Request.t -> unit
method shortest : cap
method private release : unit
method when_more_resolved : (cap -> unit) -> unit
method when_released : (unit -> unit) -> unit
method problem : Capnp_rpc_proto__.Exception.t option
+service (capnp-rpc.Capnp_rpc_proto.Cap_proxy.Make.C.service)

Class C.service

A convenience base class for creating local services. The capability is always resolved, and the default release method does nothing.

inherit base_ref
inherit ref_counted
method virtual call : struct_resolver -> Wire.Request.t -> unit
method shortest : cap
method private release : unit
method when_more_resolved : (cap -> unit) -> unit
method when_released : (unit -> unit) -> unit
method problem : Capnp_rpc_proto__.Exception.t option
diff --git a/capnp-rpc/Capnp_rpc_proto/Cap_proxy/Make/argument-1-C/class-type-base_ref/index.html b/capnp-rpc/Capnp_rpc_proto/Cap_proxy/Make/argument-1-C/class-type-base_ref/index.html index 947fa3ba..25ccc5d7 100644 --- a/capnp-rpc/Capnp_rpc_proto/Cap_proxy/Make/argument-1-C/class-type-base_ref/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Cap_proxy/Make/argument-1-C/class-type-base_ref/index.html @@ -1,2 +1,2 @@ -base_ref (capnp-rpc.Capnp_rpc_proto.Cap_proxy.Make.C.base_ref)

Class type C.base_ref

Common methods for struct_ref and cap.

method pp : Stdlib.Format.formatter -> unit
method update_rc : int -> unit

c#update_rc d adds d to c's (local) reference count. When it reaches zero, c must not be used again. A message may be sent releasing any remote resources.

method blocker : base_ref option

c#blocker is the unresolved cap or struct_ref promise that must resolve for c to resolve. This is used to help detect cycles.

method check_invariants : unit

This is for debugging. Checks its own invariants and those of other base_refs it holds. Raises Invariant_broken if there is a problem.

method sealed_dispatch : 'a. 'a Capnp_rpc_proto__.S.brand -> 'a option

c#sealed_dispatch brand extracts some private data of the given type.

+base_ref (capnp-rpc.Capnp_rpc_proto.Cap_proxy.Make.C.base_ref)

Class type C.base_ref

Common methods for struct_ref and cap.

method pp : Stdlib.Format.formatter -> unit
method update_rc : int -> unit

c#update_rc d adds d to c's (local) reference count. When it reaches zero, c must not be used again. A message may be sent releasing any remote resources.

method blocker : base_ref option

c#blocker is the unresolved cap or struct_ref promise that must resolve for c to resolve. This is used to help detect cycles.

method check_invariants : unit

This is for debugging. Checks its own invariants and those of other base_refs it holds. Raises Invariant_broken if there is a problem.

method sealed_dispatch : 'a. 'a Capnp_rpc_proto__.S.brand -> 'a option

c#sealed_dispatch brand extracts some private data of the given type.

diff --git a/capnp-rpc/Capnp_rpc_proto/Cap_proxy/Make/argument-1-C/class-type-cap/index.html b/capnp-rpc/Capnp_rpc_proto/Cap_proxy/Make/argument-1-C/class-type-cap/index.html index 638c87bd..a6e9c420 100644 --- a/capnp-rpc/Capnp_rpc_proto/Cap_proxy/Make/argument-1-C/class-type-cap/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Cap_proxy/Make/argument-1-C/class-type-cap/index.html @@ -1,2 +1,2 @@ -cap (capnp-rpc.Capnp_rpc_proto.Cap_proxy.Make.C.cap)

Class type C.cap

A 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.

inherit base_ref
method call : struct_resolver -> Wire.Request.t -> unit

c#call results msg invokes a method on c's target and eventually resolves results with the answer.

method shortest : cap

c#shortest is the shortest known path to cap. i.e. if c is forwarding to another cap, we return that, recursively.

method when_more_resolved : (cap -> unit) -> unit

c#when_more_resolved fn calls fn x when this cap becomes more resolved. fn x gets a reference to x and needs to dec_ref it. Note that the new capability can be another promise. If c is already resolved to its final value, this does nothing. If c is a far-ref, fn x will be called when it breaks. If c is forwarding to another cap, it will forward this call. If c gets released before calling fn, it will never call it.

method when_released : (unit -> unit) -> unit

c#when_released fn will call fn () when c's ref-count drops to zero. This is used for caches, to remove entries when they become invalid. For promises, fn will be transferred to the resolution if resolved. For broken caps, this method does nothing (exceptions are never released).

method problem : Capnp_rpc_proto__.Exception.t option

c#problem is the exception for a broken reference, or None if it is not known to be broken.

+cap (capnp-rpc.Capnp_rpc_proto.Cap_proxy.Make.C.cap)

Class type C.cap

A 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.

inherit base_ref
method call : struct_resolver -> Wire.Request.t -> unit

c#call results msg invokes a method on c's target and eventually resolves results with the answer.

method shortest : cap

c#shortest is the shortest known path to cap. i.e. if c is forwarding to another cap, we return that, recursively.

method when_more_resolved : (cap -> unit) -> unit

c#when_more_resolved fn calls fn x when this cap becomes more resolved. fn x gets a reference to x and needs to dec_ref it. Note that the new capability can be another promise. If c is already resolved to its final value, this does nothing. If c is a far-ref, fn x will be called when it breaks. If c is forwarding to another cap, it will forward this call. If c gets released before calling fn, it will never call it.

method when_released : (unit -> unit) -> unit

c#when_released fn will call fn () when c's ref-count drops to zero. This is used for caches, to remove entries when they become invalid. For promises, fn will be transferred to the resolution if resolved. For broken caps, this method does nothing (exceptions are never released).

method problem : Capnp_rpc_proto__.Exception.t option

c#problem is the exception for a broken reference, or None if it is not known to be broken.

diff --git a/capnp-rpc/Capnp_rpc_proto/Cap_proxy/Make/argument-1-C/class-type-struct_ref/index.html b/capnp-rpc/Capnp_rpc_proto/Cap_proxy/Make/argument-1-C/class-type-struct_ref/index.html index dd44e3a4..29c1ffa2 100644 --- a/capnp-rpc/Capnp_rpc_proto/Cap_proxy/Make/argument-1-C/class-type-struct_ref/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Cap_proxy/Make/argument-1-C/class-type-struct_ref/index.html @@ -1,2 +1,2 @@ -struct_ref (capnp-rpc.Capnp_rpc_proto.Cap_proxy.Make.C.struct_ref)

Class type C.struct_ref

The 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.

inherit base_ref
method when_resolved : (Wire.Response.t or_error -> unit) -> unit

r#when_resolved fn queues up fn to be called on the result, when it arrives. If the result has already arrived, fn is called immediately.

method response : Wire.Response.t or_error option

r#response is Some payload if the response has arrived, or None if we're still waiting.

method cap : Wire.Path.t -> cap

r#cap path is the capability found at path in the response. If the response has arrived, this will extract the capability from it. If not, it may create a capability that will pipeline through the promised answer until the result arrives (at which point it will use the new, more direct route). The caller should call cap#dec_ref when done.

+struct_ref (capnp-rpc.Capnp_rpc_proto.Cap_proxy.Make.C.struct_ref)

Class type C.struct_ref

The 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.

inherit base_ref
method when_resolved : (Wire.Response.t or_error -> unit) -> unit

r#when_resolved fn queues up fn to be called on the result, when it arrives. If the result has already arrived, fn is called immediately.

method response : Wire.Response.t or_error option

r#response is Some payload if the response has arrived, or None if we're still waiting.

method cap : Wire.Path.t -> cap

r#cap path is the capability found at path in the response. If the response has arrived, this will extract the capability from it. If not, it may create a capability that will pipeline through the promised answer until the result arrives (at which point it will use the new, more direct route). The caller should call cap#dec_ref when done.

diff --git a/capnp-rpc/Capnp_rpc_proto/Cap_proxy/Make/argument-1-C/class-type-struct_resolver/index.html b/capnp-rpc/Capnp_rpc_proto/Cap_proxy/Make/argument-1-C/class-type-struct_resolver/index.html index 789ec4c4..aaaea323 100644 --- a/capnp-rpc/Capnp_rpc_proto/Cap_proxy/Make/argument-1-C/class-type-struct_resolver/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Cap_proxy/Make/argument-1-C/class-type-struct_resolver/index.html @@ -1,2 +1,2 @@ -struct_resolver (capnp-rpc.Capnp_rpc_proto.Cap_proxy.Make.C.struct_resolver)

Class type C.struct_resolver

A struct_resolver can be used to resolve some promise.

method pp : Stdlib.Format.formatter -> unit
method resolve : struct_ref -> unit

r#resolve x causes r's promise to behave as x in future. The promise takes ownership of x (is responsible for calling dec_rec on it).

method sealed_dispatch : 'a. 'a Capnp_rpc_proto__.S.brand -> 'a option

r#sealed_dispatch brand extracts some private data of the given type.

method set_blocker : base_ref -> (unit, [> `Cycle ]) Stdlib.result

r#set_blocker b means that resolve won't be called until b is resolved. r's promise should report this as its blocker. This is needed to detect cycles. When the blocker is resolved, call this again with None to clear it (the promise will then report itself as the blocker again, until resolved).

method clear_blocker : unit

r#clear_blocker removes the blocker set by set_blocker. r is then blocked by itself, if unresolved.

+struct_resolver (capnp-rpc.Capnp_rpc_proto.Cap_proxy.Make.C.struct_resolver)

Class type C.struct_resolver

A struct_resolver can be used to resolve some promise.

method pp : Stdlib.Format.formatter -> unit
method resolve : struct_ref -> unit

r#resolve x causes r's promise to behave as x in future. The promise takes ownership of x (is responsible for calling dec_rec on it).

method sealed_dispatch : 'a. 'a Capnp_rpc_proto__.S.brand -> 'a option

r#sealed_dispatch brand extracts some private data of the given type.

method set_blocker : base_ref -> (unit, [> `Cycle ]) Stdlib.result

r#set_blocker b means that resolve won't be called until b is resolved. r's promise should report this as its blocker. This is needed to detect cycles. When the blocker is resolved, call this again with None to clear it (the promise will then report itself as the blocker again, until resolved).

method clear_blocker : unit

r#clear_blocker removes the blocker set by set_blocker. r is then blocked by itself, if unresolved.

diff --git a/capnp-rpc/Capnp_rpc_proto/Cap_proxy/Make/argument-1-C/index.html b/capnp-rpc/Capnp_rpc_proto/Cap_proxy/Make/argument-1-C/index.html index 5c412695..d82dd7e8 100644 --- a/capnp-rpc/Capnp_rpc_proto/Cap_proxy/Make/argument-1-C/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Cap_proxy/Make/argument-1-C/index.html @@ -1,5 +1,5 @@ -C (capnp-rpc.Capnp_rpc_proto.Cap_proxy.Make.C)

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.

module Wire : S.WIRE

The core RPC logic can be used with different serialisation systems. The appropriate types should be provided here.

type 'a or_error = ('a, Error.t) Stdlib.result
class type base_ref = object ... end

Common methods for struct_ref and cap.

val pp : base_ref Fmt.t
val inc_ref : base_ref -> unit

inc_ref x increases x's ref-count by one.

val dec_ref : base_ref -> unit

dec_ref x decreases x's ref-count by one.

class type struct_ref = object ... end

The 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 ... end

A 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 ... end

A struct_resolver can be used to resolve some promise.

module Attachments : sig ... end
module Request_payload : +C (capnp-rpc.Capnp_rpc_proto.Cap_proxy.Make.C)

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.

module Wire : S.WIRE

The core RPC logic can be used with different serialisation systems. The appropriate types should be provided here.

type 'a or_error = ('a, Error.t) Stdlib.result
class type base_ref = object ... end

Common methods for struct_ref and cap.

val pp : base_ref Fmt.t
val inc_ref : base_ref -> unit

inc_ref x increases x's ref-count by one.

val dec_ref : base_ref -> unit

dec_ref x decreases x's ref-count by one.

class type struct_ref = object ... end

The 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 ... end

A 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 ... end

A struct_resolver can be used to resolve some promise.

module Attachments : sig ... end
module Request_payload : S.PAYLOAD with type t = Wire.Request.t and type cap := cap diff --git a/capnp-rpc/Capnp_rpc_proto/Cap_proxy/Make/class-type-resolver_cap/index.html b/capnp-rpc/Capnp_rpc_proto/Cap_proxy/Make/class-type-resolver_cap/index.html index 5c2b4d4e..69f1a570 100644 --- a/capnp-rpc/Capnp_rpc_proto/Cap_proxy/Make/class-type-resolver_cap/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Cap_proxy/Make/class-type-resolver_cap/index.html @@ -1,2 +1,2 @@ -resolver_cap (capnp-rpc.Capnp_rpc_proto.Cap_proxy.Make.resolver_cap)

Class type Make.resolver_cap

inherit C.cap
method resolve : C.cap -> unit
method break : Capnp_rpc_proto__.Exception.t -> unit
+resolver_cap (capnp-rpc.Capnp_rpc_proto.Cap_proxy.Make.resolver_cap)

Class type Make.resolver_cap

inherit C.cap
method resolve : C.cap -> unit
method break : Capnp_rpc_proto__.Exception.t -> unit
diff --git a/capnp-rpc/Capnp_rpc_proto/Cap_proxy/Make/index.html b/capnp-rpc/Capnp_rpc_proto/Cap_proxy/Make/index.html index 8f401952..3617317c 100644 --- a/capnp-rpc/Capnp_rpc_proto/Cap_proxy/Make/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Cap_proxy/Make/index.html @@ -1,2 +1,2 @@ -Make (capnp-rpc.Capnp_rpc_proto.Cap_proxy.Make)

Module Cap_proxy.Make

Parameters

module C : S.CORE_TYPES

Signature

class type resolver_cap = object ... end
val local_promise : unit -> resolver_cap

A local_promise () is a promise that buffers calls until it is resolved.

+Make (capnp-rpc.Capnp_rpc_proto.Cap_proxy.Make)

Module Cap_proxy.Make

Parameters

module C : S.CORE_TYPES

Signature

class type resolver_cap = object ... end
val local_promise : unit -> resolver_cap

A local_promise () is a promise that buffers calls until it is resolved.

diff --git a/capnp-rpc/Capnp_rpc_proto/Cap_proxy/index.html b/capnp-rpc/Capnp_rpc_proto/Cap_proxy/index.html index 6944ac25..caf714be 100644 --- a/capnp-rpc/Capnp_rpc_proto/Cap_proxy/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Cap_proxy/index.html @@ -1,2 +1,2 @@ -Cap_proxy (capnp-rpc.Capnp_rpc_proto.Cap_proxy)

Module Capnp_rpc_proto.Cap_proxy

A local promise for a capability. Queues messages locally.

module Make (C : S.CORE_TYPES) : sig ... end
+Cap_proxy (capnp-rpc.Capnp_rpc_proto.Cap_proxy)

Module Capnp_rpc_proto.Cap_proxy

A local promise for a capability. Queues messages locally.

module Make (C : S.CORE_TYPES) : sig ... end
diff --git a/capnp-rpc/Capnp_rpc_proto/Core_types/Attachments/index.html b/capnp-rpc/Capnp_rpc_proto/Core_types/Attachments/index.html index 447f02e1..9d16bb04 100644 --- a/capnp-rpc/Capnp_rpc_proto/Core_types/Attachments/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Core_types/Attachments/index.html @@ -1,2 +1,2 @@ -Attachments (capnp-rpc.Capnp_rpc_proto.Core_types.Attachments)

Module Core_types.Attachments

val builder : unit -> S.attachments

builder () is a fresh writable attachments array.

val cap : int -> S.attachments -> cap

cap i t is the capability at index i in t. The reference count is increased by one.

val clear_cap : S.attachments -> int -> unit

Replace cap at index i with null and dec_ref it.

val add_cap : S.attachments -> cap -> int

add_cap t cap stores cap in t. t must have been created by builder. Increases the ref-count on cap by one.

val release_caps : S.attachments -> unit

release_caps a decreases the ref-count of every capability in a.

+Attachments (capnp-rpc.Capnp_rpc_proto.Core_types.Attachments)

Module Core_types.Attachments

val builder : unit -> S.attachments

builder () is a fresh writable attachments array.

val cap : int -> S.attachments -> cap

cap i t is the capability at index i in t. The reference count is increased by one.

val clear_cap : S.attachments -> int -> unit

Replace cap at index i with null and dec_ref it.

val add_cap : S.attachments -> cap -> int

add_cap t cap stores cap in t. t must have been created by builder. Increases the ref-count on cap by one.

val release_caps : S.attachments -> unit

release_caps a decreases the ref-count of every capability in a.

diff --git a/capnp-rpc/Capnp_rpc_proto/Core_types/Request_payload/index.html b/capnp-rpc/Capnp_rpc_proto/Core_types/Request_payload/index.html index 0b23e201..e1263d47 100644 --- a/capnp-rpc/Capnp_rpc_proto/Core_types/Request_payload/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Core_types/Request_payload/index.html @@ -1,2 +1,2 @@ -Request_payload (capnp-rpc.Capnp_rpc_proto.Core_types.Request_payload)

Module Core_types.Request_payload

The payload of a request message.

Wraps WIRE_PAYLOAD to deal with caps rather than attachments.

val snapshot_caps : t -> cap RO_array.t
val field : t -> Wire.Path.t -> cap option

field t path looks up path in the message and returns the capability at that index. Returns None if the field wasn't set. Returns a broken capability if an index was given but does not exist (i.e. the message is corrupted). Increases the ref-count on the result.

val with_caps : cap RO_array.t -> t -> t

with_caps caps t is a copy of t with a new set of capabilities. This is useful to implement TakeFromOtherQuestion, where the message is the same but embargoes may be needed, and to break cycles.

val release : t -> unit

release t frees all the capabilities attached to this message. It is safe to call this multiple times; only the first call has any effect.

val pp : t Fmt.t
+Request_payload (capnp-rpc.Capnp_rpc_proto.Core_types.Request_payload)

Module Core_types.Request_payload

The payload of a request message.

Wraps WIRE_PAYLOAD to deal with caps rather than attachments.

val snapshot_caps : t -> cap RO_array.t
val field : t -> Wire.Path.t -> cap option

field t path looks up path in the message and returns the capability at that index. Returns None if the field wasn't set. Returns a broken capability if an index was given but does not exist (i.e. the message is corrupted). Increases the ref-count on the result.

val with_caps : cap RO_array.t -> t -> t

with_caps caps t is a copy of t with a new set of capabilities. This is useful to implement TakeFromOtherQuestion, where the message is the same but embargoes may be needed, and to break cycles.

val release : t -> unit

release t frees all the capabilities attached to this message. It is safe to call this multiple times; only the first call has any effect.

val pp : t Fmt.t
diff --git a/capnp-rpc/Capnp_rpc_proto/Core_types/Response_payload/index.html b/capnp-rpc/Capnp_rpc_proto/Core_types/Response_payload/index.html index 0b80e98d..49215f55 100644 --- a/capnp-rpc/Capnp_rpc_proto/Core_types/Response_payload/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Core_types/Response_payload/index.html @@ -1,2 +1,2 @@ -Response_payload (capnp-rpc.Capnp_rpc_proto.Core_types.Response_payload)

Module Core_types.Response_payload

The payload of a response message.

Wraps WIRE_PAYLOAD to deal with caps rather than attachments.

val snapshot_caps : t -> cap RO_array.t
val field : t -> Wire.Path.t -> cap option

field t path looks up path in the message and returns the capability at that index. Returns None if the field wasn't set. Returns a broken capability if an index was given but does not exist (i.e. the message is corrupted). Increases the ref-count on the result.

val with_caps : cap RO_array.t -> t -> t

with_caps caps t is a copy of t with a new set of capabilities. This is useful to implement TakeFromOtherQuestion, where the message is the same but embargoes may be needed, and to break cycles.

val release : t -> unit

release t frees all the capabilities attached to this message. It is safe to call this multiple times; only the first call has any effect.

val pp : t Fmt.t
+Response_payload (capnp-rpc.Capnp_rpc_proto.Core_types.Response_payload)

Module Core_types.Response_payload

The payload of a response message.

Wraps WIRE_PAYLOAD to deal with caps rather than attachments.

val snapshot_caps : t -> cap RO_array.t
val field : t -> Wire.Path.t -> cap option

field t path looks up path in the message and returns the capability at that index. Returns None if the field wasn't set. Returns a broken capability if an index was given but does not exist (i.e. the message is corrupted). Increases the ref-count on the result.

val with_caps : cap RO_array.t -> t -> t

with_caps caps t is a copy of t with a new set of capabilities. This is useful to implement TakeFromOtherQuestion, where the message is the same but embargoes may be needed, and to break cycles.

val release : t -> unit

release t frees all the capabilities attached to this message. It is safe to call this multiple times; only the first call has any effect.

val pp : t Fmt.t
diff --git a/capnp-rpc/Capnp_rpc_proto/Core_types/argument-1-W/Path/index.html b/capnp-rpc/Capnp_rpc_proto/Core_types/argument-1-W/Path/index.html index 86aef4dc..92f4b412 100644 --- a/capnp-rpc/Capnp_rpc_proto/Core_types/argument-1-W/Path/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Core_types/argument-1-W/Path/index.html @@ -1,2 +1,2 @@ -Path (capnp-rpc.Capnp_rpc_proto.Core_types.W.Path)

Module W.Path

A field in a message that refers to a capability.

include Stdlib.Map.OrderedType
type t
val compare : t -> t -> int
val root : t

The path for the bootstrap capability in the bootstrap message.

val pp : t Fmt.t
+Path (capnp-rpc.Capnp_rpc_proto.Core_types.W.Path)

Module W.Path

A field in a message that refers to a capability.

include Stdlib.Map.OrderedType
type t
val compare : t -> t -> int
val root : t

The path for the bootstrap capability in the bootstrap message.

val pp : t Fmt.t
diff --git a/capnp-rpc/Capnp_rpc_proto/Core_types/argument-1-W/Request/index.html b/capnp-rpc/Capnp_rpc_proto/Core_types/argument-1-W/Request/index.html index d52aa300..67452373 100644 --- a/capnp-rpc/Capnp_rpc_proto/Core_types/argument-1-W/Request/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Core_types/argument-1-W/Request/index.html @@ -1,2 +1,2 @@ -Request (capnp-rpc.Capnp_rpc_proto.Core_types.W.Request)

Module W.Request

type t = request msg

A message payload. This is typically a byte array of some kind, plus a way of attaching capabilities.

val pp : t Fmt.t
val cap_index : t -> Path.t -> int option

cap_index msg path is the capability index at path in the message (i.e the index of the capability in the attachments table).

val attachments : t -> S.attachments
val with_attachments : S.attachments -> t -> t
+Request (capnp-rpc.Capnp_rpc_proto.Core_types.W.Request)

Module W.Request

type t = request msg

A message payload. This is typically a byte array of some kind, plus a way of attaching capabilities.

val pp : t Fmt.t
val cap_index : t -> Path.t -> int option

cap_index msg path is the capability index at path in the message (i.e the index of the capability in the attachments table).

val attachments : t -> S.attachments
val with_attachments : S.attachments -> t -> t
diff --git a/capnp-rpc/Capnp_rpc_proto/Core_types/argument-1-W/Response/index.html b/capnp-rpc/Capnp_rpc_proto/Core_types/argument-1-W/Response/index.html index bf694c3b..b4c0488b 100644 --- a/capnp-rpc/Capnp_rpc_proto/Core_types/argument-1-W/Response/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Core_types/argument-1-W/Response/index.html @@ -1,2 +1,2 @@ -Response (capnp-rpc.Capnp_rpc_proto.Core_types.W.Response)

Module W.Response

include S.WIRE_PAYLOAD with type t = response msg and type path := Path.t
type t = response msg

A message payload. This is typically a byte array of some kind, plus a way of attaching capabilities.

val pp : t Fmt.t
val cap_index : t -> Path.t -> int option

cap_index msg path is the capability index at path in the message (i.e the index of the capability in the attachments table).

val attachments : t -> S.attachments
val with_attachments : S.attachments -> t -> t
val bootstrap : unit -> t

The (empty) content for the reply to the bootstrap message.

+Response (capnp-rpc.Capnp_rpc_proto.Core_types.W.Response)

Module W.Response

include S.WIRE_PAYLOAD with type t = response msg and type path := Path.t
type t = response msg

A message payload. This is typically a byte array of some kind, plus a way of attaching capabilities.

val pp : t Fmt.t
val cap_index : t -> Path.t -> int option

cap_index msg path is the capability index at path in the message (i.e the index of the capability in the attachments table).

val attachments : t -> S.attachments
val with_attachments : S.attachments -> t -> t
val bootstrap : unit -> t

The (empty) content for the reply to the bootstrap message.

diff --git a/capnp-rpc/Capnp_rpc_proto/Core_types/argument-1-W/index.html b/capnp-rpc/Capnp_rpc_proto/Core_types/argument-1-W/index.html index ca26ef64..2afa338e 100644 --- a/capnp-rpc/Capnp_rpc_proto/Core_types/argument-1-W/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Core_types/argument-1-W/index.html @@ -1,3 +1,3 @@ -W (capnp-rpc.Capnp_rpc_proto.Core_types.W)

Parameter Core_types.W

The core RPC logic can be used with different serialisation systems. The appropriate types should be provided here.

type request
type response
type 'a msg
module Path : sig ... end

A field in a message that refers to a capability.

module Request : +W (capnp-rpc.Capnp_rpc_proto.Core_types.W)

Parameter Core_types.W

The core RPC logic can be used with different serialisation systems. The appropriate types should be provided here.

type request
type response
type 'a msg
module Path : sig ... end

A field in a message that refers to a capability.

module Request : S.WIRE_PAYLOAD with type t = request msg and type path := Path.t
module Response : sig ... end
val ref_leak_detected : int -> (unit -> unit) -> unit

ref_leak_detected thread_id fn is called when a promise or capability is GC'd while its ref-count is non-zero, indicating that resources may have been leaked. fn () will log a warning about this and free the resources itself. The reason for going via ref_leak_detected rather than calling fn directly is because the OCaml GC may detect the problem at any point (e.g. while we're sending another message). The implementation should arrange for fn to be called at a safe point in thread thread_id (e.g. when returning to the thread's main loop). Unit-tests may wish to call fn immediately to show the error and then fail the test.

diff --git a/capnp-rpc/Capnp_rpc_proto/Core_types/class-ref_counted/index.html b/capnp-rpc/Capnp_rpc_proto/Core_types/class-ref_counted/index.html index 9ee9a692..59e4bf15 100644 --- a/capnp-rpc/Capnp_rpc_proto/Core_types/class-ref_counted/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Core_types/class-ref_counted/index.html @@ -1,2 +1,2 @@ -ref_counted (capnp-rpc.Capnp_rpc_proto.Core_types.ref_counted)

Class Core_types.ref_counted

A mix-in to help with writing reference-counted objects. It will call self#release when the ref-count reaches zero.

method private virtual release : unit
method virtual pp : Stdlib.Format.formatter -> unit
method private pp_refcount : Stdlib.Format.formatter -> unit

Write the current ref-count to the formatter (use with "%t").

method private check_refcount : unit

Raise an exception if the ref-count is less than one (i.e. check that the object hasn't already been freed).

method update_rc : int -> unit
method check_invariants : unit
method virtual blocker : base_ref option
method sealed_dispatch : 'a. 'a Capnp_rpc_proto__.S.brand -> 'a option
+ref_counted (capnp-rpc.Capnp_rpc_proto.Core_types.ref_counted)

Class Core_types.ref_counted

A mix-in to help with writing reference-counted objects. It will call self#release when the ref-count reaches zero.

method private virtual release : unit
method virtual pp : Stdlib.Format.formatter -> unit
method private pp_refcount : Stdlib.Format.formatter -> unit

Write the current ref-count to the formatter (use with "%t").

method private check_refcount : unit

Raise an exception if the ref-count is less than one (i.e. check that the object hasn't already been freed).

method update_rc : int -> unit
method check_invariants : unit
method virtual blocker : base_ref option
method sealed_dispatch : 'a. 'a Capnp_rpc_proto__.S.brand -> 'a option
diff --git a/capnp-rpc/Capnp_rpc_proto/Core_types/class-service/index.html b/capnp-rpc/Capnp_rpc_proto/Core_types/class-service/index.html index 47503dd6..cf3fdb60 100644 --- a/capnp-rpc/Capnp_rpc_proto/Core_types/class-service/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Core_types/class-service/index.html @@ -1,2 +1,2 @@ -service (capnp-rpc.Capnp_rpc_proto.Core_types.service)

Class Core_types.service

A convenience base class for creating local services. The capability is always resolved, and the default release method does nothing.

inherit base_ref
inherit ref_counted
method virtual call : struct_resolver -> Wire.Request.t -> unit
method shortest : cap
method private release : unit
method when_more_resolved : (cap -> unit) -> unit
method when_released : (unit -> unit) -> unit
method problem : Capnp_rpc_proto__.Exception.t option
+service (capnp-rpc.Capnp_rpc_proto.Core_types.service)

Class Core_types.service

A convenience base class for creating local services. The capability is always resolved, and the default release method does nothing.

inherit base_ref
inherit ref_counted
method virtual call : struct_resolver -> Wire.Request.t -> unit
method shortest : cap
method private release : unit
method when_more_resolved : (cap -> unit) -> unit
method when_released : (unit -> unit) -> unit
method problem : Capnp_rpc_proto__.Exception.t option
diff --git a/capnp-rpc/Capnp_rpc_proto/Core_types/class-type-base_ref/index.html b/capnp-rpc/Capnp_rpc_proto/Core_types/class-type-base_ref/index.html index f5d19a8a..bb2f94c4 100644 --- a/capnp-rpc/Capnp_rpc_proto/Core_types/class-type-base_ref/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Core_types/class-type-base_ref/index.html @@ -1,2 +1,2 @@ -base_ref (capnp-rpc.Capnp_rpc_proto.Core_types.base_ref)

Class type Core_types.base_ref

Common methods for struct_ref and cap.

method pp : Stdlib.Format.formatter -> unit
method update_rc : int -> unit

c#update_rc d adds d to c's (local) reference count. When it reaches zero, c must not be used again. A message may be sent releasing any remote resources.

method blocker : base_ref option

c#blocker is the unresolved cap or struct_ref promise that must resolve for c to resolve. This is used to help detect cycles.

method check_invariants : unit

This is for debugging. Checks its own invariants and those of other base_refs it holds. Raises Invariant_broken if there is a problem.

method sealed_dispatch : 'a. 'a Capnp_rpc_proto__.S.brand -> 'a option

c#sealed_dispatch brand extracts some private data of the given type.

+base_ref (capnp-rpc.Capnp_rpc_proto.Core_types.base_ref)

Class type Core_types.base_ref

Common methods for struct_ref and cap.

method pp : Stdlib.Format.formatter -> unit
method update_rc : int -> unit

c#update_rc d adds d to c's (local) reference count. When it reaches zero, c must not be used again. A message may be sent releasing any remote resources.

method blocker : base_ref option

c#blocker is the unresolved cap or struct_ref promise that must resolve for c to resolve. This is used to help detect cycles.

method check_invariants : unit

This is for debugging. Checks its own invariants and those of other base_refs it holds. Raises Invariant_broken if there is a problem.

method sealed_dispatch : 'a. 'a Capnp_rpc_proto__.S.brand -> 'a option

c#sealed_dispatch brand extracts some private data of the given type.

diff --git a/capnp-rpc/Capnp_rpc_proto/Core_types/class-type-cap/index.html b/capnp-rpc/Capnp_rpc_proto/Core_types/class-type-cap/index.html index 5abe5a0d..eeeffb7e 100644 --- a/capnp-rpc/Capnp_rpc_proto/Core_types/class-type-cap/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Core_types/class-type-cap/index.html @@ -1,2 +1,2 @@ -cap (capnp-rpc.Capnp_rpc_proto.Core_types.cap)

Class type Core_types.cap

A 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.

inherit base_ref
method call : struct_resolver -> Wire.Request.t -> unit

c#call results msg invokes a method on c's target and eventually resolves results with the answer.

method shortest : cap

c#shortest is the shortest known path to cap. i.e. if c is forwarding to another cap, we return that, recursively.

method when_more_resolved : (cap -> unit) -> unit

c#when_more_resolved fn calls fn x when this cap becomes more resolved. fn x gets a reference to x and needs to dec_ref it. Note that the new capability can be another promise. If c is already resolved to its final value, this does nothing. If c is a far-ref, fn x will be called when it breaks. If c is forwarding to another cap, it will forward this call. If c gets released before calling fn, it will never call it.

method when_released : (unit -> unit) -> unit

c#when_released fn will call fn () when c's ref-count drops to zero. This is used for caches, to remove entries when they become invalid. For promises, fn will be transferred to the resolution if resolved. For broken caps, this method does nothing (exceptions are never released).

method problem : Capnp_rpc_proto__.Exception.t option

c#problem is the exception for a broken reference, or None if it is not known to be broken.

+cap (capnp-rpc.Capnp_rpc_proto.Core_types.cap)

Class type Core_types.cap

A 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.

inherit base_ref
method call : struct_resolver -> Wire.Request.t -> unit

c#call results msg invokes a method on c's target and eventually resolves results with the answer.

method shortest : cap

c#shortest is the shortest known path to cap. i.e. if c is forwarding to another cap, we return that, recursively.

method when_more_resolved : (cap -> unit) -> unit

c#when_more_resolved fn calls fn x when this cap becomes more resolved. fn x gets a reference to x and needs to dec_ref it. Note that the new capability can be another promise. If c is already resolved to its final value, this does nothing. If c is a far-ref, fn x will be called when it breaks. If c is forwarding to another cap, it will forward this call. If c gets released before calling fn, it will never call it.

method when_released : (unit -> unit) -> unit

c#when_released fn will call fn () when c's ref-count drops to zero. This is used for caches, to remove entries when they become invalid. For promises, fn will be transferred to the resolution if resolved. For broken caps, this method does nothing (exceptions are never released).

method problem : Capnp_rpc_proto__.Exception.t option

c#problem is the exception for a broken reference, or None if it is not known to be broken.

diff --git a/capnp-rpc/Capnp_rpc_proto/Core_types/class-type-struct_ref/index.html b/capnp-rpc/Capnp_rpc_proto/Core_types/class-type-struct_ref/index.html index 30e28887..2966c600 100644 --- a/capnp-rpc/Capnp_rpc_proto/Core_types/class-type-struct_ref/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Core_types/class-type-struct_ref/index.html @@ -1,2 +1,2 @@ -struct_ref (capnp-rpc.Capnp_rpc_proto.Core_types.struct_ref)

Class type Core_types.struct_ref

The 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.

inherit base_ref
method when_resolved : (Wire.Response.t or_error -> unit) -> unit

r#when_resolved fn queues up fn to be called on the result, when it arrives. If the result has already arrived, fn is called immediately.

method response : Wire.Response.t or_error option

r#response is Some payload if the response has arrived, or None if we're still waiting.

method cap : Wire.Path.t -> cap

r#cap path is the capability found at path in the response. If the response has arrived, this will extract the capability from it. If not, it may create a capability that will pipeline through the promised answer until the result arrives (at which point it will use the new, more direct route). The caller should call cap#dec_ref when done.

+struct_ref (capnp-rpc.Capnp_rpc_proto.Core_types.struct_ref)

Class type Core_types.struct_ref

The 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.

inherit base_ref
method when_resolved : (Wire.Response.t or_error -> unit) -> unit

r#when_resolved fn queues up fn to be called on the result, when it arrives. If the result has already arrived, fn is called immediately.

method response : Wire.Response.t or_error option

r#response is Some payload if the response has arrived, or None if we're still waiting.

method cap : Wire.Path.t -> cap

r#cap path is the capability found at path in the response. If the response has arrived, this will extract the capability from it. If not, it may create a capability that will pipeline through the promised answer until the result arrives (at which point it will use the new, more direct route). The caller should call cap#dec_ref when done.

diff --git a/capnp-rpc/Capnp_rpc_proto/Core_types/class-type-struct_resolver/index.html b/capnp-rpc/Capnp_rpc_proto/Core_types/class-type-struct_resolver/index.html index e94ba64b..96dfe9ff 100644 --- a/capnp-rpc/Capnp_rpc_proto/Core_types/class-type-struct_resolver/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Core_types/class-type-struct_resolver/index.html @@ -1,2 +1,2 @@ -struct_resolver (capnp-rpc.Capnp_rpc_proto.Core_types.struct_resolver)

Class type Core_types.struct_resolver

A struct_resolver can be used to resolve some promise.

method pp : Stdlib.Format.formatter -> unit
method resolve : struct_ref -> unit

r#resolve x causes r's promise to behave as x in future. The promise takes ownership of x (is responsible for calling dec_rec on it).

method sealed_dispatch : 'a. 'a Capnp_rpc_proto__.S.brand -> 'a option

r#sealed_dispatch brand extracts some private data of the given type.

method set_blocker : base_ref -> (unit, [> `Cycle ]) Stdlib.result

r#set_blocker b means that resolve won't be called until b is resolved. r's promise should report this as its blocker. This is needed to detect cycles. When the blocker is resolved, call this again with None to clear it (the promise will then report itself as the blocker again, until resolved).

method clear_blocker : unit

r#clear_blocker removes the blocker set by set_blocker. r is then blocked by itself, if unresolved.

+struct_resolver (capnp-rpc.Capnp_rpc_proto.Core_types.struct_resolver)

Class type Core_types.struct_resolver

A struct_resolver can be used to resolve some promise.

method pp : Stdlib.Format.formatter -> unit
method resolve : struct_ref -> unit

r#resolve x causes r's promise to behave as x in future. The promise takes ownership of x (is responsible for calling dec_rec on it).

method sealed_dispatch : 'a. 'a Capnp_rpc_proto__.S.brand -> 'a option

r#sealed_dispatch brand extracts some private data of the given type.

method set_blocker : base_ref -> (unit, [> `Cycle ]) Stdlib.result

r#set_blocker b means that resolve won't be called until b is resolved. r's promise should report this as its blocker. This is needed to detect cycles. When the blocker is resolved, call this again with None to clear it (the promise will then report itself as the blocker again, until resolved).

method clear_blocker : unit

r#clear_blocker removes the blocker set by set_blocker. r is then blocked by itself, if unresolved.

diff --git a/capnp-rpc/Capnp_rpc_proto/Core_types/index.html b/capnp-rpc/Capnp_rpc_proto/Core_types/index.html index 0f8bf339..abeee054 100644 --- a/capnp-rpc/Capnp_rpc_proto/Core_types/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Core_types/index.html @@ -1,5 +1,5 @@ -Core_types (capnp-rpc.Capnp_rpc_proto.Core_types)

Module Capnp_rpc_proto.Core_types

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.

Parameters

module W : S.WIRE

Signature

module Wire = W
type 'a or_error = ('a, Error.t) Stdlib.result
class type base_ref = object ... end

Common methods for struct_ref and cap.

val pp : base_ref Fmt.t
val inc_ref : base_ref -> unit

inc_ref x increases x's ref-count by one.

val dec_ref : base_ref -> unit

dec_ref x decreases x's ref-count by one.

class type struct_ref = object ... end

The 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 ... end

A 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 ... end

A struct_resolver can be used to resolve some promise.

module Attachments : sig ... end
module Request_payload : +Core_types (capnp-rpc.Capnp_rpc_proto.Core_types)

Module Capnp_rpc_proto.Core_types

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.

Parameters

module W : S.WIRE

Signature

module Wire = W
type 'a or_error = ('a, Error.t) Stdlib.result
class type base_ref = object ... end

Common methods for struct_ref and cap.

val pp : base_ref Fmt.t
val inc_ref : base_ref -> unit

inc_ref x increases x's ref-count by one.

val dec_ref : base_ref -> unit

dec_ref x decreases x's ref-count by one.

class type struct_ref = object ... end

The 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 ... end

A 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 ... end

A struct_resolver can be used to resolve some promise.

module Attachments : sig ... end
module Request_payload : S.PAYLOAD with type t = Wire.Request.t and type cap := cap diff --git a/capnp-rpc/Capnp_rpc_proto/Debug/OID/index.html b/capnp-rpc/Capnp_rpc_proto/Debug/OID/index.html index dc1eb0c2..111cbec9 100644 --- a/capnp-rpc/Capnp_rpc_proto/Debug/OID/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Debug/OID/index.html @@ -1,2 +1,2 @@ -OID (capnp-rpc.Capnp_rpc_proto.Debug.OID)

Module Debug.OID

Unique object IDs, for debugging.

type t

A unique ID which can be attached to objects to aid debugging.

val next : unit -> t

next () is a fresh ID, unique since the last reset.

val pp : t Fmt.t
val reset : unit -> unit

Reset the counter. Possibly useful in unit or fuzz tests.

+OID (capnp-rpc.Capnp_rpc_proto.Debug.OID)

Module Debug.OID

Unique object IDs, for debugging.

type t

A unique ID which can be attached to objects to aid debugging.

val next : unit -> t

next () is a fresh ID, unique since the last reset.

val pp : t Fmt.t
val reset : unit -> unit

Reset the counter. Possibly useful in unit or fuzz tests.

diff --git a/capnp-rpc/Capnp_rpc_proto/Debug/index.html b/capnp-rpc/Capnp_rpc_proto/Debug/index.html index 191f1f99..7d8c235d 100644 --- a/capnp-rpc/Capnp_rpc_proto/Debug/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Debug/index.html @@ -1,2 +1,2 @@ -Debug (capnp-rpc.Capnp_rpc_proto.Debug)

Module Capnp_rpc_proto.Debug

Diagnostics.

module Log : Logs.LOG

The library's logger.

val src : Logs.src

Control the log level for Log.

val qid_tag : Stdint.Uint32.t Logs.Tag.def

qid_tag is used in log reports to tag the question (or answer) ID in the call.

exception Invariant_broken of Stdlib.Format.formatter -> unit
val pp_exn : exn Fmt.t

pp_exn is like Fmt.exn, but pretty-prints Invariant_broken.

val failf : ('a, Stdlib.Format.formatter, unit, 'b) Stdlib.format4 -> 'a

failf msg raises Failure msg.

  • deprecated Use Fmt.failwith instead
val invariant_broken : (Stdlib.Format.formatter -> unit) -> 'a

invariant_broken msg raises Invariant_broken msg.

module OID : sig ... end

Unique object IDs, for debugging.

+Debug (capnp-rpc.Capnp_rpc_proto.Debug)

Module Capnp_rpc_proto.Debug

Diagnostics.

module Log : Logs.LOG

The library's logger.

val src : Logs.src

Control the log level for Log.

val qid_tag : Stdint.Uint32.t Logs.Tag.def

qid_tag is used in log reports to tag the question (or answer) ID in the call.

exception Invariant_broken of Stdlib.Format.formatter -> unit
val pp_exn : exn Fmt.t

pp_exn is like Fmt.exn, but pretty-prints Invariant_broken.

val failf : ('a, Stdlib.Format.formatter, unit, 'b) Stdlib.format4 -> 'a

failf msg raises Failure msg.

  • deprecated Use Fmt.failwith instead
val invariant_broken : (Stdlib.Format.formatter -> unit) -> 'a

invariant_broken msg raises Invariant_broken msg.

module OID : sig ... end

Unique object IDs, for debugging.

diff --git a/capnp-rpc/Capnp_rpc_proto/Error/index.html b/capnp-rpc/Capnp_rpc_proto/Error/index.html index 3a9cb088..6bbd460a 100644 --- a/capnp-rpc/Capnp_rpc_proto/Error/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Error/index.html @@ -1,5 +1,5 @@ -Error (capnp-rpc.Capnp_rpc_proto.Error)

Module Capnp_rpc_proto.Error

Errors returned by calls.

type t = [
  1. | `Exception of Exception.t
  2. | `Cancelled
]
val pp : +Error (capnp-rpc.Capnp_rpc_proto.Error)

Module Capnp_rpc_proto.Error

Errors returned by calls.

type t = [
  1. | `Exception of Exception.t
  2. | `Cancelled
]
val pp : Stdlib.Format.formatter -> [< `Cancelled | `Exception of Exception.t ] -> unit
val exn : diff --git a/capnp-rpc/Capnp_rpc_proto/Exception/index.html b/capnp-rpc/Capnp_rpc_proto/Exception/index.html index 9a213721..bb6312e8 100644 --- a/capnp-rpc/Capnp_rpc_proto/Exception/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Exception/index.html @@ -1,5 +1,5 @@ -Exception (capnp-rpc.Capnp_rpc_proto.Exception)

Module Capnp_rpc_proto.Exception

Cap'n Proto exceptions.

type ty = [
  1. | `Failed
  2. | `Overloaded
  3. | `Disconnected
  4. | `Unimplemented
  5. | `Undefined of int
]
type t = {
  1. ty : ty;
  2. reason : string;
}
val pp_ty : +Exception (capnp-rpc.Capnp_rpc_proto.Exception)

Module Capnp_rpc_proto.Exception

Cap'n Proto exceptions.

type ty = [
  1. | `Failed
  2. | `Overloaded
  3. | `Disconnected
  4. | `Unimplemented
  5. | `Undefined of int
]
type t = {
  1. ty : ty;
  2. reason : string;
}
val pp_ty : Stdlib.Format.formatter -> [< `Disconnected | `Failed diff --git a/capnp-rpc/Capnp_rpc_proto/Id/Make/index.html b/capnp-rpc/Capnp_rpc_proto/Id/Make/index.html index b37b24bf..1d7415a7 100644 --- a/capnp-rpc/Capnp_rpc_proto/Id/Make/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Id/Make/index.html @@ -1,2 +1,2 @@ -Make (capnp-rpc.Capnp_rpc_proto.Id.Make)

Module Id.Make

Parameters

Signature

type t = private Stdint.Uint32.t
val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
+Make (capnp-rpc.Capnp_rpc_proto.Id.Make)

Module Id.Make

Parameters

Signature

type t = private Stdint.Uint32.t
val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
diff --git a/capnp-rpc/Capnp_rpc_proto/Id/index.html b/capnp-rpc/Capnp_rpc_proto/Id/index.html index 6ba81a6f..519cd555 100644 --- a/capnp-rpc/Capnp_rpc_proto/Id/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Id/index.html @@ -1,2 +1,2 @@ -Id (capnp-rpc.Capnp_rpc_proto.Id)

Module Capnp_rpc_proto.Id

Unique identifiers.

module type S = sig ... end
module Make () : S
+Id (capnp-rpc.Capnp_rpc_proto.Id)

Module Capnp_rpc_proto.Id

Unique identifiers.

module type S = sig ... end
module Make () : S
diff --git a/capnp-rpc/Capnp_rpc_proto/Id/module-type-S/index.html b/capnp-rpc/Capnp_rpc_proto/Id/module-type-S/index.html index 96ece6ef..4fbeb07b 100644 --- a/capnp-rpc/Capnp_rpc_proto/Id/module-type-S/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Id/module-type-S/index.html @@ -1,2 +1,2 @@ -S (capnp-rpc.Capnp_rpc_proto.Id.S)

Module type Id.S

type t = private Stdint.Uint32.t
val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
+S (capnp-rpc.Capnp_rpc_proto.Id.S)

Module type Id.S

type t = private Stdint.Uint32.t
val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
diff --git a/capnp-rpc/Capnp_rpc_proto/Local_struct_promise/Make/argument-1-C/Attachments/index.html b/capnp-rpc/Capnp_rpc_proto/Local_struct_promise/Make/argument-1-C/Attachments/index.html index e5dadbc5..4d977bbd 100644 --- a/capnp-rpc/Capnp_rpc_proto/Local_struct_promise/Make/argument-1-C/Attachments/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Local_struct_promise/Make/argument-1-C/Attachments/index.html @@ -1,2 +1,2 @@ -Attachments (capnp-rpc.Capnp_rpc_proto.Local_struct_promise.Make.C.Attachments)

Module C.Attachments

val builder : unit -> S.attachments

builder () is a fresh writable attachments array.

val cap : int -> S.attachments -> cap

cap i t is the capability at index i in t. The reference count is increased by one.

val clear_cap : S.attachments -> int -> unit

Replace cap at index i with null and dec_ref it.

val add_cap : S.attachments -> cap -> int

add_cap t cap stores cap in t. t must have been created by builder. Increases the ref-count on cap by one.

val release_caps : S.attachments -> unit

release_caps a decreases the ref-count of every capability in a.

+Attachments (capnp-rpc.Capnp_rpc_proto.Local_struct_promise.Make.C.Attachments)

Module C.Attachments

val builder : unit -> S.attachments

builder () is a fresh writable attachments array.

val cap : int -> S.attachments -> cap

cap i t is the capability at index i in t. The reference count is increased by one.

val clear_cap : S.attachments -> int -> unit

Replace cap at index i with null and dec_ref it.

val add_cap : S.attachments -> cap -> int

add_cap t cap stores cap in t. t must have been created by builder. Increases the ref-count on cap by one.

val release_caps : S.attachments -> unit

release_caps a decreases the ref-count of every capability in a.

diff --git a/capnp-rpc/Capnp_rpc_proto/Local_struct_promise/Make/argument-1-C/Request_payload/index.html b/capnp-rpc/Capnp_rpc_proto/Local_struct_promise/Make/argument-1-C/Request_payload/index.html index 8b52ad8f..c09bb33f 100644 --- a/capnp-rpc/Capnp_rpc_proto/Local_struct_promise/Make/argument-1-C/Request_payload/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Local_struct_promise/Make/argument-1-C/Request_payload/index.html @@ -1,2 +1,2 @@ -Request_payload (capnp-rpc.Capnp_rpc_proto.Local_struct_promise.Make.C.Request_payload)

Module C.Request_payload

The payload of a request message.

Wraps WIRE_PAYLOAD to deal with caps rather than attachments.

val snapshot_caps : t -> cap RO_array.t
val field : t -> Wire.Path.t -> cap option

field t path looks up path in the message and returns the capability at that index. Returns None if the field wasn't set. Returns a broken capability if an index was given but does not exist (i.e. the message is corrupted). Increases the ref-count on the result.

val with_caps : cap RO_array.t -> t -> t

with_caps caps t is a copy of t with a new set of capabilities. This is useful to implement TakeFromOtherQuestion, where the message is the same but embargoes may be needed, and to break cycles.

val release : t -> unit

release t frees all the capabilities attached to this message. It is safe to call this multiple times; only the first call has any effect.

val pp : t Fmt.t
+Request_payload (capnp-rpc.Capnp_rpc_proto.Local_struct_promise.Make.C.Request_payload)

Module C.Request_payload

The payload of a request message.

Wraps WIRE_PAYLOAD to deal with caps rather than attachments.

val snapshot_caps : t -> cap RO_array.t
val field : t -> Wire.Path.t -> cap option

field t path looks up path in the message and returns the capability at that index. Returns None if the field wasn't set. Returns a broken capability if an index was given but does not exist (i.e. the message is corrupted). Increases the ref-count on the result.

val with_caps : cap RO_array.t -> t -> t

with_caps caps t is a copy of t with a new set of capabilities. This is useful to implement TakeFromOtherQuestion, where the message is the same but embargoes may be needed, and to break cycles.

val release : t -> unit

release t frees all the capabilities attached to this message. It is safe to call this multiple times; only the first call has any effect.

val pp : t Fmt.t
diff --git a/capnp-rpc/Capnp_rpc_proto/Local_struct_promise/Make/argument-1-C/Response_payload/index.html b/capnp-rpc/Capnp_rpc_proto/Local_struct_promise/Make/argument-1-C/Response_payload/index.html index 69c92f56..a7852926 100644 --- a/capnp-rpc/Capnp_rpc_proto/Local_struct_promise/Make/argument-1-C/Response_payload/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Local_struct_promise/Make/argument-1-C/Response_payload/index.html @@ -1,2 +1,2 @@ -Response_payload (capnp-rpc.Capnp_rpc_proto.Local_struct_promise.Make.C.Response_payload)

Module C.Response_payload

The payload of a response message.

Wraps WIRE_PAYLOAD to deal with caps rather than attachments.

val snapshot_caps : t -> cap RO_array.t
val field : t -> Wire.Path.t -> cap option

field t path looks up path in the message and returns the capability at that index. Returns None if the field wasn't set. Returns a broken capability if an index was given but does not exist (i.e. the message is corrupted). Increases the ref-count on the result.

val with_caps : cap RO_array.t -> t -> t

with_caps caps t is a copy of t with a new set of capabilities. This is useful to implement TakeFromOtherQuestion, where the message is the same but embargoes may be needed, and to break cycles.

val release : t -> unit

release t frees all the capabilities attached to this message. It is safe to call this multiple times; only the first call has any effect.

val pp : t Fmt.t
+Response_payload (capnp-rpc.Capnp_rpc_proto.Local_struct_promise.Make.C.Response_payload)

Module C.Response_payload

The payload of a response message.

Wraps WIRE_PAYLOAD to deal with caps rather than attachments.

val snapshot_caps : t -> cap RO_array.t
val field : t -> Wire.Path.t -> cap option

field t path looks up path in the message and returns the capability at that index. Returns None if the field wasn't set. Returns a broken capability if an index was given but does not exist (i.e. the message is corrupted). Increases the ref-count on the result.

val with_caps : cap RO_array.t -> t -> t

with_caps caps t is a copy of t with a new set of capabilities. This is useful to implement TakeFromOtherQuestion, where the message is the same but embargoes may be needed, and to break cycles.

val release : t -> unit

release t frees all the capabilities attached to this message. It is safe to call this multiple times; only the first call has any effect.

val pp : t Fmt.t
diff --git a/capnp-rpc/Capnp_rpc_proto/Local_struct_promise/Make/argument-1-C/Wire/Path/index.html b/capnp-rpc/Capnp_rpc_proto/Local_struct_promise/Make/argument-1-C/Wire/Path/index.html index 0556734c..7b51e7c8 100644 --- a/capnp-rpc/Capnp_rpc_proto/Local_struct_promise/Make/argument-1-C/Wire/Path/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Local_struct_promise/Make/argument-1-C/Wire/Path/index.html @@ -1,2 +1,2 @@ -Path (capnp-rpc.Capnp_rpc_proto.Local_struct_promise.Make.C.Wire.Path)

Module Wire.Path

A field in a message that refers to a capability.

include Stdlib.Map.OrderedType
type t
val compare : t -> t -> int
val root : t

The path for the bootstrap capability in the bootstrap message.

val pp : t Fmt.t
+Path (capnp-rpc.Capnp_rpc_proto.Local_struct_promise.Make.C.Wire.Path)

Module Wire.Path

A field in a message that refers to a capability.

include Stdlib.Map.OrderedType
type t
val compare : t -> t -> int
val root : t

The path for the bootstrap capability in the bootstrap message.

val pp : t Fmt.t
diff --git a/capnp-rpc/Capnp_rpc_proto/Local_struct_promise/Make/argument-1-C/Wire/Request/index.html b/capnp-rpc/Capnp_rpc_proto/Local_struct_promise/Make/argument-1-C/Wire/Request/index.html index a1255ff6..80930745 100644 --- a/capnp-rpc/Capnp_rpc_proto/Local_struct_promise/Make/argument-1-C/Wire/Request/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Local_struct_promise/Make/argument-1-C/Wire/Request/index.html @@ -1,2 +1,2 @@ -Request (capnp-rpc.Capnp_rpc_proto.Local_struct_promise.Make.C.Wire.Request)

Module Wire.Request

type t = request msg

A message payload. This is typically a byte array of some kind, plus a way of attaching capabilities.

val pp : t Fmt.t
val cap_index : t -> Path.t -> int option

cap_index msg path is the capability index at path in the message (i.e the index of the capability in the attachments table).

val attachments : t -> S.attachments
val with_attachments : S.attachments -> t -> t
+Request (capnp-rpc.Capnp_rpc_proto.Local_struct_promise.Make.C.Wire.Request)

Module Wire.Request

type t = request msg

A message payload. This is typically a byte array of some kind, plus a way of attaching capabilities.

val pp : t Fmt.t
val cap_index : t -> Path.t -> int option

cap_index msg path is the capability index at path in the message (i.e the index of the capability in the attachments table).

val attachments : t -> S.attachments
val with_attachments : S.attachments -> t -> t
diff --git a/capnp-rpc/Capnp_rpc_proto/Local_struct_promise/Make/argument-1-C/Wire/Response/index.html b/capnp-rpc/Capnp_rpc_proto/Local_struct_promise/Make/argument-1-C/Wire/Response/index.html index 532e29e6..b818fd66 100644 --- a/capnp-rpc/Capnp_rpc_proto/Local_struct_promise/Make/argument-1-C/Wire/Response/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Local_struct_promise/Make/argument-1-C/Wire/Response/index.html @@ -1,2 +1,2 @@ -Response (capnp-rpc.Capnp_rpc_proto.Local_struct_promise.Make.C.Wire.Response)

Module Wire.Response

include S.WIRE_PAYLOAD with type t = response msg and type path := Path.t
type t = response msg

A message payload. This is typically a byte array of some kind, plus a way of attaching capabilities.

val pp : t Fmt.t
val cap_index : t -> Path.t -> int option

cap_index msg path is the capability index at path in the message (i.e the index of the capability in the attachments table).

val attachments : t -> S.attachments
val with_attachments : S.attachments -> t -> t
val bootstrap : unit -> t

The (empty) content for the reply to the bootstrap message.

+Response (capnp-rpc.Capnp_rpc_proto.Local_struct_promise.Make.C.Wire.Response)

Module Wire.Response

include S.WIRE_PAYLOAD with type t = response msg and type path := Path.t
type t = response msg

A message payload. This is typically a byte array of some kind, plus a way of attaching capabilities.

val pp : t Fmt.t
val cap_index : t -> Path.t -> int option

cap_index msg path is the capability index at path in the message (i.e the index of the capability in the attachments table).

val attachments : t -> S.attachments
val with_attachments : S.attachments -> t -> t
val bootstrap : unit -> t

The (empty) content for the reply to the bootstrap message.

diff --git a/capnp-rpc/Capnp_rpc_proto/Local_struct_promise/Make/argument-1-C/Wire/index.html b/capnp-rpc/Capnp_rpc_proto/Local_struct_promise/Make/argument-1-C/Wire/index.html index a3948303..fd3182c2 100644 --- a/capnp-rpc/Capnp_rpc_proto/Local_struct_promise/Make/argument-1-C/Wire/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Local_struct_promise/Make/argument-1-C/Wire/index.html @@ -1,3 +1,3 @@ -Wire (capnp-rpc.Capnp_rpc_proto.Local_struct_promise.Make.C.Wire)

Module C.Wire

The core RPC logic can be used with different serialisation systems. The appropriate types should be provided here.

type request
type response
type 'a msg
module Path : sig ... end

A field in a message that refers to a capability.

module Request : +Wire (capnp-rpc.Capnp_rpc_proto.Local_struct_promise.Make.C.Wire)

Module C.Wire

The core RPC logic can be used with different serialisation systems. The appropriate types should be provided here.

type request
type response
type 'a msg
module Path : sig ... end

A field in a message that refers to a capability.

module Request : S.WIRE_PAYLOAD with type t = request msg and type path := Path.t
module Response : sig ... end
val ref_leak_detected : int -> (unit -> unit) -> unit

ref_leak_detected thread_id fn is called when a promise or capability is GC'd while its ref-count is non-zero, indicating that resources may have been leaked. fn () will log a warning about this and free the resources itself. The reason for going via ref_leak_detected rather than calling fn directly is because the OCaml GC may detect the problem at any point (e.g. while we're sending another message). The implementation should arrange for fn to be called at a safe point in thread thread_id (e.g. when returning to the thread's main loop). Unit-tests may wish to call fn immediately to show the error and then fail the test.

diff --git a/capnp-rpc/Capnp_rpc_proto/Local_struct_promise/Make/argument-1-C/class-ref_counted/index.html b/capnp-rpc/Capnp_rpc_proto/Local_struct_promise/Make/argument-1-C/class-ref_counted/index.html index 3ecd2f1b..2a63cfd9 100644 --- a/capnp-rpc/Capnp_rpc_proto/Local_struct_promise/Make/argument-1-C/class-ref_counted/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Local_struct_promise/Make/argument-1-C/class-ref_counted/index.html @@ -1,2 +1,2 @@ -ref_counted (capnp-rpc.Capnp_rpc_proto.Local_struct_promise.Make.C.ref_counted)

Class C.ref_counted

A mix-in to help with writing reference-counted objects. It will call self#release when the ref-count reaches zero.

method private virtual release : unit
method virtual pp : Stdlib.Format.formatter -> unit
method private pp_refcount : Stdlib.Format.formatter -> unit

Write the current ref-count to the formatter (use with "%t").

method private check_refcount : unit

Raise an exception if the ref-count is less than one (i.e. check that the object hasn't already been freed).

method update_rc : int -> unit
method check_invariants : unit
method virtual blocker : base_ref option
method sealed_dispatch : 'a. 'a Capnp_rpc_proto__.S.brand -> 'a option
+ref_counted (capnp-rpc.Capnp_rpc_proto.Local_struct_promise.Make.C.ref_counted)

Class C.ref_counted

A mix-in to help with writing reference-counted objects. It will call self#release when the ref-count reaches zero.

method private virtual release : unit
method virtual pp : Stdlib.Format.formatter -> unit
method private pp_refcount : Stdlib.Format.formatter -> unit

Write the current ref-count to the formatter (use with "%t").

method private check_refcount : unit

Raise an exception if the ref-count is less than one (i.e. check that the object hasn't already been freed).

method update_rc : int -> unit
method check_invariants : unit
method virtual blocker : base_ref option
method sealed_dispatch : 'a. 'a Capnp_rpc_proto__.S.brand -> 'a option
diff --git a/capnp-rpc/Capnp_rpc_proto/Local_struct_promise/Make/argument-1-C/class-service/index.html b/capnp-rpc/Capnp_rpc_proto/Local_struct_promise/Make/argument-1-C/class-service/index.html index 48c73964..93b17f4e 100644 --- a/capnp-rpc/Capnp_rpc_proto/Local_struct_promise/Make/argument-1-C/class-service/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Local_struct_promise/Make/argument-1-C/class-service/index.html @@ -1,2 +1,2 @@ -service (capnp-rpc.Capnp_rpc_proto.Local_struct_promise.Make.C.service)

Class C.service

A convenience base class for creating local services. The capability is always resolved, and the default release method does nothing.

inherit base_ref
inherit ref_counted
method virtual call : struct_resolver -> Wire.Request.t -> unit
method shortest : cap
method private release : unit
method when_more_resolved : (cap -> unit) -> unit
method when_released : (unit -> unit) -> unit
method problem : Capnp_rpc_proto__.Exception.t option
+service (capnp-rpc.Capnp_rpc_proto.Local_struct_promise.Make.C.service)

Class C.service

A convenience base class for creating local services. The capability is always resolved, and the default release method does nothing.

inherit base_ref
inherit ref_counted
method virtual call : struct_resolver -> Wire.Request.t -> unit
method shortest : cap
method private release : unit
method when_more_resolved : (cap -> unit) -> unit
method when_released : (unit -> unit) -> unit
method problem : Capnp_rpc_proto__.Exception.t option
diff --git a/capnp-rpc/Capnp_rpc_proto/Local_struct_promise/Make/argument-1-C/class-type-base_ref/index.html b/capnp-rpc/Capnp_rpc_proto/Local_struct_promise/Make/argument-1-C/class-type-base_ref/index.html index d4362163..0e6c26ec 100644 --- a/capnp-rpc/Capnp_rpc_proto/Local_struct_promise/Make/argument-1-C/class-type-base_ref/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Local_struct_promise/Make/argument-1-C/class-type-base_ref/index.html @@ -1,2 +1,2 @@ -base_ref (capnp-rpc.Capnp_rpc_proto.Local_struct_promise.Make.C.base_ref)

Class type C.base_ref

Common methods for struct_ref and cap.

method pp : Stdlib.Format.formatter -> unit
method update_rc : int -> unit

c#update_rc d adds d to c's (local) reference count. When it reaches zero, c must not be used again. A message may be sent releasing any remote resources.

method blocker : base_ref option

c#blocker is the unresolved cap or struct_ref promise that must resolve for c to resolve. This is used to help detect cycles.

method check_invariants : unit

This is for debugging. Checks its own invariants and those of other base_refs it holds. Raises Invariant_broken if there is a problem.

method sealed_dispatch : 'a. 'a Capnp_rpc_proto__.S.brand -> 'a option

c#sealed_dispatch brand extracts some private data of the given type.

+base_ref (capnp-rpc.Capnp_rpc_proto.Local_struct_promise.Make.C.base_ref)

Class type C.base_ref

Common methods for struct_ref and cap.

method pp : Stdlib.Format.formatter -> unit
method update_rc : int -> unit

c#update_rc d adds d to c's (local) reference count. When it reaches zero, c must not be used again. A message may be sent releasing any remote resources.

method blocker : base_ref option

c#blocker is the unresolved cap or struct_ref promise that must resolve for c to resolve. This is used to help detect cycles.

method check_invariants : unit

This is for debugging. Checks its own invariants and those of other base_refs it holds. Raises Invariant_broken if there is a problem.

method sealed_dispatch : 'a. 'a Capnp_rpc_proto__.S.brand -> 'a option

c#sealed_dispatch brand extracts some private data of the given type.

diff --git a/capnp-rpc/Capnp_rpc_proto/Local_struct_promise/Make/argument-1-C/class-type-cap/index.html b/capnp-rpc/Capnp_rpc_proto/Local_struct_promise/Make/argument-1-C/class-type-cap/index.html index bb8a580b..8acd0881 100644 --- a/capnp-rpc/Capnp_rpc_proto/Local_struct_promise/Make/argument-1-C/class-type-cap/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Local_struct_promise/Make/argument-1-C/class-type-cap/index.html @@ -1,2 +1,2 @@ -cap (capnp-rpc.Capnp_rpc_proto.Local_struct_promise.Make.C.cap)

Class type C.cap

A 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.

inherit base_ref
method call : struct_resolver -> Wire.Request.t -> unit

c#call results msg invokes a method on c's target and eventually resolves results with the answer.

method shortest : cap

c#shortest is the shortest known path to cap. i.e. if c is forwarding to another cap, we return that, recursively.

method when_more_resolved : (cap -> unit) -> unit

c#when_more_resolved fn calls fn x when this cap becomes more resolved. fn x gets a reference to x and needs to dec_ref it. Note that the new capability can be another promise. If c is already resolved to its final value, this does nothing. If c is a far-ref, fn x will be called when it breaks. If c is forwarding to another cap, it will forward this call. If c gets released before calling fn, it will never call it.

method when_released : (unit -> unit) -> unit

c#when_released fn will call fn () when c's ref-count drops to zero. This is used for caches, to remove entries when they become invalid. For promises, fn will be transferred to the resolution if resolved. For broken caps, this method does nothing (exceptions are never released).

method problem : Capnp_rpc_proto__.Exception.t option

c#problem is the exception for a broken reference, or None if it is not known to be broken.

+cap (capnp-rpc.Capnp_rpc_proto.Local_struct_promise.Make.C.cap)

Class type C.cap

A 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.

inherit base_ref
method call : struct_resolver -> Wire.Request.t -> unit

c#call results msg invokes a method on c's target and eventually resolves results with the answer.

method shortest : cap

c#shortest is the shortest known path to cap. i.e. if c is forwarding to another cap, we return that, recursively.

method when_more_resolved : (cap -> unit) -> unit

c#when_more_resolved fn calls fn x when this cap becomes more resolved. fn x gets a reference to x and needs to dec_ref it. Note that the new capability can be another promise. If c is already resolved to its final value, this does nothing. If c is a far-ref, fn x will be called when it breaks. If c is forwarding to another cap, it will forward this call. If c gets released before calling fn, it will never call it.

method when_released : (unit -> unit) -> unit

c#when_released fn will call fn () when c's ref-count drops to zero. This is used for caches, to remove entries when they become invalid. For promises, fn will be transferred to the resolution if resolved. For broken caps, this method does nothing (exceptions are never released).

method problem : Capnp_rpc_proto__.Exception.t option

c#problem is the exception for a broken reference, or None if it is not known to be broken.

diff --git a/capnp-rpc/Capnp_rpc_proto/Local_struct_promise/Make/argument-1-C/class-type-struct_ref/index.html b/capnp-rpc/Capnp_rpc_proto/Local_struct_promise/Make/argument-1-C/class-type-struct_ref/index.html index bbdad7b2..b327021b 100644 --- a/capnp-rpc/Capnp_rpc_proto/Local_struct_promise/Make/argument-1-C/class-type-struct_ref/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Local_struct_promise/Make/argument-1-C/class-type-struct_ref/index.html @@ -1,2 +1,2 @@ -struct_ref (capnp-rpc.Capnp_rpc_proto.Local_struct_promise.Make.C.struct_ref)

Class type C.struct_ref

The 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.

inherit base_ref
method when_resolved : (Wire.Response.t or_error -> unit) -> unit

r#when_resolved fn queues up fn to be called on the result, when it arrives. If the result has already arrived, fn is called immediately.

method response : Wire.Response.t or_error option

r#response is Some payload if the response has arrived, or None if we're still waiting.

method cap : Wire.Path.t -> cap

r#cap path is the capability found at path in the response. If the response has arrived, this will extract the capability from it. If not, it may create a capability that will pipeline through the promised answer until the result arrives (at which point it will use the new, more direct route). The caller should call cap#dec_ref when done.

+struct_ref (capnp-rpc.Capnp_rpc_proto.Local_struct_promise.Make.C.struct_ref)

Class type C.struct_ref

The 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.

inherit base_ref
method when_resolved : (Wire.Response.t or_error -> unit) -> unit

r#when_resolved fn queues up fn to be called on the result, when it arrives. If the result has already arrived, fn is called immediately.

method response : Wire.Response.t or_error option

r#response is Some payload if the response has arrived, or None if we're still waiting.

method cap : Wire.Path.t -> cap

r#cap path is the capability found at path in the response. If the response has arrived, this will extract the capability from it. If not, it may create a capability that will pipeline through the promised answer until the result arrives (at which point it will use the new, more direct route). The caller should call cap#dec_ref when done.

diff --git a/capnp-rpc/Capnp_rpc_proto/Local_struct_promise/Make/argument-1-C/class-type-struct_resolver/index.html b/capnp-rpc/Capnp_rpc_proto/Local_struct_promise/Make/argument-1-C/class-type-struct_resolver/index.html index 03015859..93c79db7 100644 --- a/capnp-rpc/Capnp_rpc_proto/Local_struct_promise/Make/argument-1-C/class-type-struct_resolver/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Local_struct_promise/Make/argument-1-C/class-type-struct_resolver/index.html @@ -1,2 +1,2 @@ -struct_resolver (capnp-rpc.Capnp_rpc_proto.Local_struct_promise.Make.C.struct_resolver)

Class type C.struct_resolver

A struct_resolver can be used to resolve some promise.

method pp : Stdlib.Format.formatter -> unit
method resolve : struct_ref -> unit

r#resolve x causes r's promise to behave as x in future. The promise takes ownership of x (is responsible for calling dec_rec on it).

method sealed_dispatch : 'a. 'a Capnp_rpc_proto__.S.brand -> 'a option

r#sealed_dispatch brand extracts some private data of the given type.

method set_blocker : base_ref -> (unit, [> `Cycle ]) Stdlib.result

r#set_blocker b means that resolve won't be called until b is resolved. r's promise should report this as its blocker. This is needed to detect cycles. When the blocker is resolved, call this again with None to clear it (the promise will then report itself as the blocker again, until resolved).

method clear_blocker : unit

r#clear_blocker removes the blocker set by set_blocker. r is then blocked by itself, if unresolved.

+struct_resolver (capnp-rpc.Capnp_rpc_proto.Local_struct_promise.Make.C.struct_resolver)

Class type C.struct_resolver

A struct_resolver can be used to resolve some promise.

method pp : Stdlib.Format.formatter -> unit
method resolve : struct_ref -> unit

r#resolve x causes r's promise to behave as x in future. The promise takes ownership of x (is responsible for calling dec_rec on it).

method sealed_dispatch : 'a. 'a Capnp_rpc_proto__.S.brand -> 'a option

r#sealed_dispatch brand extracts some private data of the given type.

method set_blocker : base_ref -> (unit, [> `Cycle ]) Stdlib.result

r#set_blocker b means that resolve won't be called until b is resolved. r's promise should report this as its blocker. This is needed to detect cycles. When the blocker is resolved, call this again with None to clear it (the promise will then report itself as the blocker again, until resolved).

method clear_blocker : unit

r#clear_blocker removes the blocker set by set_blocker. r is then blocked by itself, if unresolved.

diff --git a/capnp-rpc/Capnp_rpc_proto/Local_struct_promise/Make/argument-1-C/index.html b/capnp-rpc/Capnp_rpc_proto/Local_struct_promise/Make/argument-1-C/index.html index a785f53f..6a329575 100644 --- a/capnp-rpc/Capnp_rpc_proto/Local_struct_promise/Make/argument-1-C/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Local_struct_promise/Make/argument-1-C/index.html @@ -1,5 +1,5 @@ -C (capnp-rpc.Capnp_rpc_proto.Local_struct_promise.Make.C)

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.

module Wire : S.WIRE

The core RPC logic can be used with different serialisation systems. The appropriate types should be provided here.

type 'a or_error = ('a, Error.t) Stdlib.result
class type base_ref = object ... end

Common methods for struct_ref and cap.

val pp : base_ref Fmt.t
val inc_ref : base_ref -> unit

inc_ref x increases x's ref-count by one.

val dec_ref : base_ref -> unit

dec_ref x decreases x's ref-count by one.

class type struct_ref = object ... end

The 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 ... end

A 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 ... end

A struct_resolver can be used to resolve some promise.

module Attachments : sig ... end
module Request_payload : +C (capnp-rpc.Capnp_rpc_proto.Local_struct_promise.Make.C)

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.

module Wire : S.WIRE

The core RPC logic can be used with different serialisation systems. The appropriate types should be provided here.

type 'a or_error = ('a, Error.t) Stdlib.result
class type base_ref = object ... end

Common methods for struct_ref and cap.

val pp : base_ref Fmt.t
val inc_ref : base_ref -> unit

inc_ref x increases x's ref-count by one.

val dec_ref : base_ref -> unit

dec_ref x decreases x's ref-count by one.

class type struct_ref = object ... end

The 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 ... end

A 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 ... end

A struct_resolver can be used to resolve some promise.

module Attachments : sig ... end
module Request_payload : S.PAYLOAD with type t = Wire.Request.t and type cap := cap diff --git a/capnp-rpc/Capnp_rpc_proto/Local_struct_promise/Make/index.html b/capnp-rpc/Capnp_rpc_proto/Local_struct_promise/Make/index.html index ebea90a5..84ef4058 100644 --- a/capnp-rpc/Capnp_rpc_proto/Local_struct_promise/Make/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Local_struct_promise/Make/index.html @@ -1,2 +1,2 @@ -Make (capnp-rpc.Capnp_rpc_proto.Local_struct_promise.Make)

Module Local_struct_promise.Make

Parameters

module C : S.CORE_TYPES

Signature

val make : unit -> C.struct_ref * C.struct_resolver
+Make (capnp-rpc.Capnp_rpc_proto.Local_struct_promise.Make)

Module Local_struct_promise.Make

Parameters

module C : S.CORE_TYPES

Signature

val make : unit -> C.struct_ref * C.struct_resolver
diff --git a/capnp-rpc/Capnp_rpc_proto/Local_struct_promise/index.html b/capnp-rpc/Capnp_rpc_proto/Local_struct_promise/index.html index 2a66bd76..4368d1d7 100644 --- a/capnp-rpc/Capnp_rpc_proto/Local_struct_promise/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Local_struct_promise/index.html @@ -1,2 +1,2 @@ -Local_struct_promise (capnp-rpc.Capnp_rpc_proto.Local_struct_promise)

Module Capnp_rpc_proto.Local_struct_promise

A local promise for a call response. Queues messages locally.

module Make (C : S.CORE_TYPES) : sig ... end
+Local_struct_promise (capnp-rpc.Capnp_rpc_proto.Local_struct_promise)

Module Capnp_rpc_proto.Local_struct_promise

A local promise for a call response. Queues messages locally.

module Make (C : S.CORE_TYPES) : sig ... end
diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/EmbargoId/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/EmbargoId/index.html index c0d4f0ba..f48f2048 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/EmbargoId/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/EmbargoId/index.html @@ -1,2 +1,2 @@ -EmbargoId (capnp-rpc.Capnp_rpc_proto.Message_types.EmbargoId)

Module Message_types.EmbargoId

type t = private Stdint.Uint32.t
val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
+EmbargoId (capnp-rpc.Capnp_rpc_proto.Message_types.EmbargoId)

Module Message_types.EmbargoId

type t = private Stdint.Uint32.t
val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/In/AnswerId/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/In/AnswerId/index.html index d550712e..7a5c0ae7 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/In/AnswerId/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/In/AnswerId/index.html @@ -1,2 +1,2 @@ -AnswerId (capnp-rpc.Capnp_rpc_proto.Message_types.Endpoint.In.AnswerId)

Module In.AnswerId

val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
+AnswerId (capnp-rpc.Capnp_rpc_proto.Message_types.Endpoint.In.AnswerId)

Module In.AnswerId

val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/In/ExportId/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/In/ExportId/index.html index 2b565433..1e9b100c 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/In/ExportId/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/In/ExportId/index.html @@ -1,2 +1,2 @@ -ExportId (capnp-rpc.Capnp_rpc_proto.Message_types.Endpoint.In.ExportId)

Module In.ExportId

val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
+ExportId (capnp-rpc.Capnp_rpc_proto.Message_types.Endpoint.In.ExportId)

Module In.ExportId

val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/In/ImportId/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/In/ImportId/index.html index dafd5af5..d6cc2987 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/In/ImportId/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/In/ImportId/index.html @@ -1,2 +1,2 @@ -ImportId (capnp-rpc.Capnp_rpc_proto.Message_types.Endpoint.In.ImportId)

Module In.ImportId

val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
+ImportId (capnp-rpc.Capnp_rpc_proto.Message_types.Endpoint.In.ImportId)

Module In.ImportId

val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/In/QuestionId/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/In/QuestionId/index.html index 2f527dc6..b7827bb1 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/In/QuestionId/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/In/QuestionId/index.html @@ -1,2 +1,2 @@ -QuestionId (capnp-rpc.Capnp_rpc_proto.Message_types.Endpoint.In.QuestionId)

Module In.QuestionId

val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
+QuestionId (capnp-rpc.Capnp_rpc_proto.Message_types.Endpoint.In.QuestionId)

Module In.QuestionId

val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/In/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/In/index.html index dbd1c8d3..6a29ef98 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/In/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/In/index.html @@ -1,5 +1,5 @@ -In (capnp-rpc.Capnp_rpc_proto.Message_types.Endpoint.In)

Module Endpoint.In

module QuestionId : sig ... end
module AnswerId : sig ... end
module ImportId : sig ... end
module ExportId : sig ... end
type message_target = [
  1. | `ReceiverAnswer of QuestionId.t * Core_types.Wire.Path.t
  2. | `ReceiverHosted of ImportId.t
]
type desc = [
  1. | `None
  2. | `ReceiverAnswer of QuestionId.t * Core_types.Wire.Path.t
  3. | `ReceiverHosted of ImportId.t
  4. | `SenderHosted of ExportId.t
  5. | `SenderPromise of ExportId.t
  6. | `ThirdPartyHosted of third_party_desc
]
val pp_desc : +In (capnp-rpc.Capnp_rpc_proto.Message_types.Endpoint.In)

Module Endpoint.In

module QuestionId : sig ... end
module AnswerId : sig ... end
module ImportId : sig ... end
module ExportId : sig ... end
type message_target = [
  1. | `ReceiverAnswer of QuestionId.t * Core_types.Wire.Path.t
  2. | `ReceiverHosted of ImportId.t
]
type desc = [
  1. | `None
  2. | `ReceiverAnswer of QuestionId.t * Core_types.Wire.Path.t
  3. | `ReceiverHosted of ImportId.t
  4. | `SenderHosted of ExportId.t
  5. | `SenderPromise of ExportId.t
  6. | `ThirdPartyHosted of third_party_desc
]
val pp_desc : Stdlib.Format.formatter -> [< `Local of < pp : Stdlib.Format.formatter -> unit.. > | `None diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/Out/AnswerId/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/Out/AnswerId/index.html index bec2b4f2..d6be9334 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/Out/AnswerId/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/Out/AnswerId/index.html @@ -1,2 +1,2 @@ -AnswerId (capnp-rpc.Capnp_rpc_proto.Message_types.Endpoint.Out.AnswerId)

Module Out.AnswerId

val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
+AnswerId (capnp-rpc.Capnp_rpc_proto.Message_types.Endpoint.Out.AnswerId)

Module Out.AnswerId

val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/Out/ExportId/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/Out/ExportId/index.html index e5ba0260..dc9ba1ae 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/Out/ExportId/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/Out/ExportId/index.html @@ -1,2 +1,2 @@ -ExportId (capnp-rpc.Capnp_rpc_proto.Message_types.Endpoint.Out.ExportId)

Module Out.ExportId

val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
+ExportId (capnp-rpc.Capnp_rpc_proto.Message_types.Endpoint.Out.ExportId)

Module Out.ExportId

val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/Out/ImportId/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/Out/ImportId/index.html index 8f30c73c..7ea4fae4 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/Out/ImportId/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/Out/ImportId/index.html @@ -1,2 +1,2 @@ -ImportId (capnp-rpc.Capnp_rpc_proto.Message_types.Endpoint.Out.ImportId)

Module Out.ImportId

val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
+ImportId (capnp-rpc.Capnp_rpc_proto.Message_types.Endpoint.Out.ImportId)

Module Out.ImportId

val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/Out/QuestionId/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/Out/QuestionId/index.html index 230c8ea9..539d4cb9 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/Out/QuestionId/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/Out/QuestionId/index.html @@ -1,2 +1,2 @@ -QuestionId (capnp-rpc.Capnp_rpc_proto.Message_types.Endpoint.Out.QuestionId)

Module Out.QuestionId

val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
+QuestionId (capnp-rpc.Capnp_rpc_proto.Message_types.Endpoint.Out.QuestionId)

Module Out.QuestionId

val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/Out/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/Out/index.html index 4bd5b799..4bd84dad 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/Out/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/Out/index.html @@ -1,5 +1,5 @@ -Out (capnp-rpc.Capnp_rpc_proto.Message_types.Endpoint.Out)

Module Endpoint.Out

module QuestionId : sig ... end
module AnswerId : sig ... end
module ImportId : sig ... end
module ExportId : sig ... end
type message_target = [
  1. | `ReceiverAnswer of QuestionId.t * Core_types.Wire.Path.t
  2. | `ReceiverHosted of ImportId.t
]
type desc = [
  1. | `None
  2. | `ReceiverAnswer of QuestionId.t * Core_types.Wire.Path.t
  3. | `ReceiverHosted of ImportId.t
  4. | `SenderHosted of ExportId.t
  5. | `SenderPromise of ExportId.t
  6. | `ThirdPartyHosted of third_party_desc
]
val pp_desc : +Out (capnp-rpc.Capnp_rpc_proto.Message_types.Endpoint.Out)

Module Endpoint.Out

module QuestionId : sig ... end
module AnswerId : sig ... end
module ImportId : sig ... end
module ExportId : sig ... end
type message_target = [
  1. | `ReceiverAnswer of QuestionId.t * Core_types.Wire.Path.t
  2. | `ReceiverHosted of ImportId.t
]
type desc = [
  1. | `None
  2. | `ReceiverAnswer of QuestionId.t * Core_types.Wire.Path.t
  3. | `ReceiverHosted of ImportId.t
  4. | `SenderHosted of ExportId.t
  5. | `SenderPromise of ExportId.t
  6. | `ThirdPartyHosted of third_party_desc
]
val pp_desc : Stdlib.Format.formatter -> [< `Local of < pp : Stdlib.Format.formatter -> unit.. > | `None diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/argument-1-Core_types/Attachments/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/argument-1-Core_types/Attachments/index.html index a016e9ac..2527bb47 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/argument-1-Core_types/Attachments/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/argument-1-Core_types/Attachments/index.html @@ -1,2 +1,2 @@ -Attachments (capnp-rpc.Capnp_rpc_proto.Message_types.Endpoint.Core_types.Attachments)

Module Core_types.Attachments

val builder : unit -> S.attachments

builder () is a fresh writable attachments array.

val cap : int -> S.attachments -> cap

cap i t is the capability at index i in t. The reference count is increased by one.

val clear_cap : S.attachments -> int -> unit

Replace cap at index i with null and dec_ref it.

val add_cap : S.attachments -> cap -> int

add_cap t cap stores cap in t. t must have been created by builder. Increases the ref-count on cap by one.

val release_caps : S.attachments -> unit

release_caps a decreases the ref-count of every capability in a.

+Attachments (capnp-rpc.Capnp_rpc_proto.Message_types.Endpoint.Core_types.Attachments)

Module Core_types.Attachments

val builder : unit -> S.attachments

builder () is a fresh writable attachments array.

val cap : int -> S.attachments -> cap

cap i t is the capability at index i in t. The reference count is increased by one.

val clear_cap : S.attachments -> int -> unit

Replace cap at index i with null and dec_ref it.

val add_cap : S.attachments -> cap -> int

add_cap t cap stores cap in t. t must have been created by builder. Increases the ref-count on cap by one.

val release_caps : S.attachments -> unit

release_caps a decreases the ref-count of every capability in a.

diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/argument-1-Core_types/Request_payload/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/argument-1-Core_types/Request_payload/index.html index 7f747d5c..8ca05238 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/argument-1-Core_types/Request_payload/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/argument-1-Core_types/Request_payload/index.html @@ -1,2 +1,2 @@ -Request_payload (capnp-rpc.Capnp_rpc_proto.Message_types.Endpoint.Core_types.Request_payload)

Module Core_types.Request_payload

The payload of a request message.

Wraps WIRE_PAYLOAD to deal with caps rather than attachments.

val snapshot_caps : t -> cap RO_array.t
val field : t -> Wire.Path.t -> cap option

field t path looks up path in the message and returns the capability at that index. Returns None if the field wasn't set. Returns a broken capability if an index was given but does not exist (i.e. the message is corrupted). Increases the ref-count on the result.

val with_caps : cap RO_array.t -> t -> t

with_caps caps t is a copy of t with a new set of capabilities. This is useful to implement TakeFromOtherQuestion, where the message is the same but embargoes may be needed, and to break cycles.

val release : t -> unit

release t frees all the capabilities attached to this message. It is safe to call this multiple times; only the first call has any effect.

val pp : t Fmt.t
+Request_payload (capnp-rpc.Capnp_rpc_proto.Message_types.Endpoint.Core_types.Request_payload)

Module Core_types.Request_payload

The payload of a request message.

Wraps WIRE_PAYLOAD to deal with caps rather than attachments.

val snapshot_caps : t -> cap RO_array.t
val field : t -> Wire.Path.t -> cap option

field t path looks up path in the message and returns the capability at that index. Returns None if the field wasn't set. Returns a broken capability if an index was given but does not exist (i.e. the message is corrupted). Increases the ref-count on the result.

val with_caps : cap RO_array.t -> t -> t

with_caps caps t is a copy of t with a new set of capabilities. This is useful to implement TakeFromOtherQuestion, where the message is the same but embargoes may be needed, and to break cycles.

val release : t -> unit

release t frees all the capabilities attached to this message. It is safe to call this multiple times; only the first call has any effect.

val pp : t Fmt.t
diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/argument-1-Core_types/Response_payload/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/argument-1-Core_types/Response_payload/index.html index e8cea27a..39074d30 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/argument-1-Core_types/Response_payload/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/argument-1-Core_types/Response_payload/index.html @@ -1,2 +1,2 @@ -Response_payload (capnp-rpc.Capnp_rpc_proto.Message_types.Endpoint.Core_types.Response_payload)

Module Core_types.Response_payload

The payload of a response message.

Wraps WIRE_PAYLOAD to deal with caps rather than attachments.

val snapshot_caps : t -> cap RO_array.t
val field : t -> Wire.Path.t -> cap option

field t path looks up path in the message and returns the capability at that index. Returns None if the field wasn't set. Returns a broken capability if an index was given but does not exist (i.e. the message is corrupted). Increases the ref-count on the result.

val with_caps : cap RO_array.t -> t -> t

with_caps caps t is a copy of t with a new set of capabilities. This is useful to implement TakeFromOtherQuestion, where the message is the same but embargoes may be needed, and to break cycles.

val release : t -> unit

release t frees all the capabilities attached to this message. It is safe to call this multiple times; only the first call has any effect.

val pp : t Fmt.t
+Response_payload (capnp-rpc.Capnp_rpc_proto.Message_types.Endpoint.Core_types.Response_payload)

Module Core_types.Response_payload

The payload of a response message.

Wraps WIRE_PAYLOAD to deal with caps rather than attachments.

val snapshot_caps : t -> cap RO_array.t
val field : t -> Wire.Path.t -> cap option

field t path looks up path in the message and returns the capability at that index. Returns None if the field wasn't set. Returns a broken capability if an index was given but does not exist (i.e. the message is corrupted). Increases the ref-count on the result.

val with_caps : cap RO_array.t -> t -> t

with_caps caps t is a copy of t with a new set of capabilities. This is useful to implement TakeFromOtherQuestion, where the message is the same but embargoes may be needed, and to break cycles.

val release : t -> unit

release t frees all the capabilities attached to this message. It is safe to call this multiple times; only the first call has any effect.

val pp : t Fmt.t
diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/argument-1-Core_types/Wire/Path/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/argument-1-Core_types/Wire/Path/index.html index 4543b281..a6994e02 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/argument-1-Core_types/Wire/Path/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/argument-1-Core_types/Wire/Path/index.html @@ -1,2 +1,2 @@ -Path (capnp-rpc.Capnp_rpc_proto.Message_types.Endpoint.Core_types.Wire.Path)

Module Wire.Path

A field in a message that refers to a capability.

include Stdlib.Map.OrderedType
type t
val compare : t -> t -> int
val root : t

The path for the bootstrap capability in the bootstrap message.

val pp : t Fmt.t
+Path (capnp-rpc.Capnp_rpc_proto.Message_types.Endpoint.Core_types.Wire.Path)

Module Wire.Path

A field in a message that refers to a capability.

include Stdlib.Map.OrderedType
type t
val compare : t -> t -> int
val root : t

The path for the bootstrap capability in the bootstrap message.

val pp : t Fmt.t
diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/argument-1-Core_types/Wire/Request/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/argument-1-Core_types/Wire/Request/index.html index 10e046a6..7103a091 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/argument-1-Core_types/Wire/Request/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/argument-1-Core_types/Wire/Request/index.html @@ -1,2 +1,2 @@ -Request (capnp-rpc.Capnp_rpc_proto.Message_types.Endpoint.Core_types.Wire.Request)

Module Wire.Request

type t = request msg

A message payload. This is typically a byte array of some kind, plus a way of attaching capabilities.

val pp : t Fmt.t
val cap_index : t -> Path.t -> int option

cap_index msg path is the capability index at path in the message (i.e the index of the capability in the attachments table).

val attachments : t -> S.attachments
val with_attachments : S.attachments -> t -> t
+Request (capnp-rpc.Capnp_rpc_proto.Message_types.Endpoint.Core_types.Wire.Request)

Module Wire.Request

type t = request msg

A message payload. This is typically a byte array of some kind, plus a way of attaching capabilities.

val pp : t Fmt.t
val cap_index : t -> Path.t -> int option

cap_index msg path is the capability index at path in the message (i.e the index of the capability in the attachments table).

val attachments : t -> S.attachments
val with_attachments : S.attachments -> t -> t
diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/argument-1-Core_types/Wire/Response/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/argument-1-Core_types/Wire/Response/index.html index 8221bc13..cc93748e 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/argument-1-Core_types/Wire/Response/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/argument-1-Core_types/Wire/Response/index.html @@ -1,2 +1,2 @@ -Response (capnp-rpc.Capnp_rpc_proto.Message_types.Endpoint.Core_types.Wire.Response)

Module Wire.Response

include S.WIRE_PAYLOAD with type t = response msg and type path := Path.t
type t = response msg

A message payload. This is typically a byte array of some kind, plus a way of attaching capabilities.

val pp : t Fmt.t
val cap_index : t -> Path.t -> int option

cap_index msg path is the capability index at path in the message (i.e the index of the capability in the attachments table).

val attachments : t -> S.attachments
val with_attachments : S.attachments -> t -> t
val bootstrap : unit -> t

The (empty) content for the reply to the bootstrap message.

+Response (capnp-rpc.Capnp_rpc_proto.Message_types.Endpoint.Core_types.Wire.Response)

Module Wire.Response

include S.WIRE_PAYLOAD with type t = response msg and type path := Path.t
type t = response msg

A message payload. This is typically a byte array of some kind, plus a way of attaching capabilities.

val pp : t Fmt.t
val cap_index : t -> Path.t -> int option

cap_index msg path is the capability index at path in the message (i.e the index of the capability in the attachments table).

val attachments : t -> S.attachments
val with_attachments : S.attachments -> t -> t
val bootstrap : unit -> t

The (empty) content for the reply to the bootstrap message.

diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/argument-1-Core_types/Wire/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/argument-1-Core_types/Wire/index.html index 053cb6a6..f22cbba0 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/argument-1-Core_types/Wire/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/argument-1-Core_types/Wire/index.html @@ -1,3 +1,3 @@ -Wire (capnp-rpc.Capnp_rpc_proto.Message_types.Endpoint.Core_types.Wire)

Module Core_types.Wire

The core RPC logic can be used with different serialisation systems. The appropriate types should be provided here.

type request
type response
type 'a msg
module Path : sig ... end

A field in a message that refers to a capability.

module Request : +Wire (capnp-rpc.Capnp_rpc_proto.Message_types.Endpoint.Core_types.Wire)

Module Core_types.Wire

The core RPC logic can be used with different serialisation systems. The appropriate types should be provided here.

type request
type response
type 'a msg
module Path : sig ... end

A field in a message that refers to a capability.

module Request : S.WIRE_PAYLOAD with type t = request msg and type path := Path.t
module Response : sig ... end
val ref_leak_detected : int -> (unit -> unit) -> unit

ref_leak_detected thread_id fn is called when a promise or capability is GC'd while its ref-count is non-zero, indicating that resources may have been leaked. fn () will log a warning about this and free the resources itself. The reason for going via ref_leak_detected rather than calling fn directly is because the OCaml GC may detect the problem at any point (e.g. while we're sending another message). The implementation should arrange for fn to be called at a safe point in thread thread_id (e.g. when returning to the thread's main loop). Unit-tests may wish to call fn immediately to show the error and then fail the test.

diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/argument-1-Core_types/class-ref_counted/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/argument-1-Core_types/class-ref_counted/index.html index f67edd85..66822228 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/argument-1-Core_types/class-ref_counted/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/argument-1-Core_types/class-ref_counted/index.html @@ -1,2 +1,2 @@ -ref_counted (capnp-rpc.Capnp_rpc_proto.Message_types.Endpoint.Core_types.ref_counted)

Class Core_types.ref_counted

A mix-in to help with writing reference-counted objects. It will call self#release when the ref-count reaches zero.

method private virtual release : unit
method virtual pp : Stdlib.Format.formatter -> unit
method private pp_refcount : Stdlib.Format.formatter -> unit

Write the current ref-count to the formatter (use with "%t").

method private check_refcount : unit

Raise an exception if the ref-count is less than one (i.e. check that the object hasn't already been freed).

method update_rc : int -> unit
method check_invariants : unit
method virtual blocker : base_ref option
method sealed_dispatch : 'a. 'a Capnp_rpc_proto__.S.brand -> 'a option
+ref_counted (capnp-rpc.Capnp_rpc_proto.Message_types.Endpoint.Core_types.ref_counted)

Class Core_types.ref_counted

A mix-in to help with writing reference-counted objects. It will call self#release when the ref-count reaches zero.

method private virtual release : unit
method virtual pp : Stdlib.Format.formatter -> unit
method private pp_refcount : Stdlib.Format.formatter -> unit

Write the current ref-count to the formatter (use with "%t").

method private check_refcount : unit

Raise an exception if the ref-count is less than one (i.e. check that the object hasn't already been freed).

method update_rc : int -> unit
method check_invariants : unit
method virtual blocker : base_ref option
method sealed_dispatch : 'a. 'a Capnp_rpc_proto__.S.brand -> 'a option
diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/argument-1-Core_types/class-service/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/argument-1-Core_types/class-service/index.html index 92ecca18..7b0db23d 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/argument-1-Core_types/class-service/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/argument-1-Core_types/class-service/index.html @@ -1,2 +1,2 @@ -service (capnp-rpc.Capnp_rpc_proto.Message_types.Endpoint.Core_types.service)

Class Core_types.service

A convenience base class for creating local services. The capability is always resolved, and the default release method does nothing.

inherit base_ref
inherit ref_counted
method virtual call : struct_resolver -> Wire.Request.t -> unit
method shortest : cap
method private release : unit
method when_more_resolved : (cap -> unit) -> unit
method when_released : (unit -> unit) -> unit
method problem : Capnp_rpc_proto__.Exception.t option
+service (capnp-rpc.Capnp_rpc_proto.Message_types.Endpoint.Core_types.service)

Class Core_types.service

A convenience base class for creating local services. The capability is always resolved, and the default release method does nothing.

inherit base_ref
inherit ref_counted
method virtual call : struct_resolver -> Wire.Request.t -> unit
method shortest : cap
method private release : unit
method when_more_resolved : (cap -> unit) -> unit
method when_released : (unit -> unit) -> unit
method problem : Capnp_rpc_proto__.Exception.t option
diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/argument-1-Core_types/class-type-base_ref/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/argument-1-Core_types/class-type-base_ref/index.html index 0ede0599..2bb77b11 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/argument-1-Core_types/class-type-base_ref/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/argument-1-Core_types/class-type-base_ref/index.html @@ -1,2 +1,2 @@ -base_ref (capnp-rpc.Capnp_rpc_proto.Message_types.Endpoint.Core_types.base_ref)

Class type Core_types.base_ref

Common methods for struct_ref and cap.

method pp : Stdlib.Format.formatter -> unit
method update_rc : int -> unit

c#update_rc d adds d to c's (local) reference count. When it reaches zero, c must not be used again. A message may be sent releasing any remote resources.

method blocker : base_ref option

c#blocker is the unresolved cap or struct_ref promise that must resolve for c to resolve. This is used to help detect cycles.

method check_invariants : unit

This is for debugging. Checks its own invariants and those of other base_refs it holds. Raises Invariant_broken if there is a problem.

method sealed_dispatch : 'a. 'a Capnp_rpc_proto__.S.brand -> 'a option

c#sealed_dispatch brand extracts some private data of the given type.

+base_ref (capnp-rpc.Capnp_rpc_proto.Message_types.Endpoint.Core_types.base_ref)

Class type Core_types.base_ref

Common methods for struct_ref and cap.

method pp : Stdlib.Format.formatter -> unit
method update_rc : int -> unit

c#update_rc d adds d to c's (local) reference count. When it reaches zero, c must not be used again. A message may be sent releasing any remote resources.

method blocker : base_ref option

c#blocker is the unresolved cap or struct_ref promise that must resolve for c to resolve. This is used to help detect cycles.

method check_invariants : unit

This is for debugging. Checks its own invariants and those of other base_refs it holds. Raises Invariant_broken if there is a problem.

method sealed_dispatch : 'a. 'a Capnp_rpc_proto__.S.brand -> 'a option

c#sealed_dispatch brand extracts some private data of the given type.

diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/argument-1-Core_types/class-type-cap/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/argument-1-Core_types/class-type-cap/index.html index 0a2a1ecc..06b1e60e 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/argument-1-Core_types/class-type-cap/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/argument-1-Core_types/class-type-cap/index.html @@ -1,2 +1,2 @@ -cap (capnp-rpc.Capnp_rpc_proto.Message_types.Endpoint.Core_types.cap)

Class type Core_types.cap

A 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.

inherit base_ref
method call : struct_resolver -> Wire.Request.t -> unit

c#call results msg invokes a method on c's target and eventually resolves results with the answer.

method shortest : cap

c#shortest is the shortest known path to cap. i.e. if c is forwarding to another cap, we return that, recursively.

method when_more_resolved : (cap -> unit) -> unit

c#when_more_resolved fn calls fn x when this cap becomes more resolved. fn x gets a reference to x and needs to dec_ref it. Note that the new capability can be another promise. If c is already resolved to its final value, this does nothing. If c is a far-ref, fn x will be called when it breaks. If c is forwarding to another cap, it will forward this call. If c gets released before calling fn, it will never call it.

method when_released : (unit -> unit) -> unit

c#when_released fn will call fn () when c's ref-count drops to zero. This is used for caches, to remove entries when they become invalid. For promises, fn will be transferred to the resolution if resolved. For broken caps, this method does nothing (exceptions are never released).

method problem : Capnp_rpc_proto__.Exception.t option

c#problem is the exception for a broken reference, or None if it is not known to be broken.

+cap (capnp-rpc.Capnp_rpc_proto.Message_types.Endpoint.Core_types.cap)

Class type Core_types.cap

A 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.

inherit base_ref
method call : struct_resolver -> Wire.Request.t -> unit

c#call results msg invokes a method on c's target and eventually resolves results with the answer.

method shortest : cap

c#shortest is the shortest known path to cap. i.e. if c is forwarding to another cap, we return that, recursively.

method when_more_resolved : (cap -> unit) -> unit

c#when_more_resolved fn calls fn x when this cap becomes more resolved. fn x gets a reference to x and needs to dec_ref it. Note that the new capability can be another promise. If c is already resolved to its final value, this does nothing. If c is a far-ref, fn x will be called when it breaks. If c is forwarding to another cap, it will forward this call. If c gets released before calling fn, it will never call it.

method when_released : (unit -> unit) -> unit

c#when_released fn will call fn () when c's ref-count drops to zero. This is used for caches, to remove entries when they become invalid. For promises, fn will be transferred to the resolution if resolved. For broken caps, this method does nothing (exceptions are never released).

method problem : Capnp_rpc_proto__.Exception.t option

c#problem is the exception for a broken reference, or None if it is not known to be broken.

diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/argument-1-Core_types/class-type-struct_ref/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/argument-1-Core_types/class-type-struct_ref/index.html index dbf670f3..4129eef8 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/argument-1-Core_types/class-type-struct_ref/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/argument-1-Core_types/class-type-struct_ref/index.html @@ -1,2 +1,2 @@ -struct_ref (capnp-rpc.Capnp_rpc_proto.Message_types.Endpoint.Core_types.struct_ref)

Class type Core_types.struct_ref

The 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.

inherit base_ref
method when_resolved : (Wire.Response.t or_error -> unit) -> unit

r#when_resolved fn queues up fn to be called on the result, when it arrives. If the result has already arrived, fn is called immediately.

method response : Wire.Response.t or_error option

r#response is Some payload if the response has arrived, or None if we're still waiting.

method cap : Wire.Path.t -> cap

r#cap path is the capability found at path in the response. If the response has arrived, this will extract the capability from it. If not, it may create a capability that will pipeline through the promised answer until the result arrives (at which point it will use the new, more direct route). The caller should call cap#dec_ref when done.

+struct_ref (capnp-rpc.Capnp_rpc_proto.Message_types.Endpoint.Core_types.struct_ref)

Class type Core_types.struct_ref

The 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.

inherit base_ref
method when_resolved : (Wire.Response.t or_error -> unit) -> unit

r#when_resolved fn queues up fn to be called on the result, when it arrives. If the result has already arrived, fn is called immediately.

method response : Wire.Response.t or_error option

r#response is Some payload if the response has arrived, or None if we're still waiting.

method cap : Wire.Path.t -> cap

r#cap path is the capability found at path in the response. If the response has arrived, this will extract the capability from it. If not, it may create a capability that will pipeline through the promised answer until the result arrives (at which point it will use the new, more direct route). The caller should call cap#dec_ref when done.

diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/argument-1-Core_types/class-type-struct_resolver/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/argument-1-Core_types/class-type-struct_resolver/index.html index 726400b1..7776f5c4 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/argument-1-Core_types/class-type-struct_resolver/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/argument-1-Core_types/class-type-struct_resolver/index.html @@ -1,2 +1,2 @@ -struct_resolver (capnp-rpc.Capnp_rpc_proto.Message_types.Endpoint.Core_types.struct_resolver)

Class type Core_types.struct_resolver

A struct_resolver can be used to resolve some promise.

method pp : Stdlib.Format.formatter -> unit
method resolve : struct_ref -> unit

r#resolve x causes r's promise to behave as x in future. The promise takes ownership of x (is responsible for calling dec_rec on it).

method sealed_dispatch : 'a. 'a Capnp_rpc_proto__.S.brand -> 'a option

r#sealed_dispatch brand extracts some private data of the given type.

method set_blocker : base_ref -> (unit, [> `Cycle ]) Stdlib.result

r#set_blocker b means that resolve won't be called until b is resolved. r's promise should report this as its blocker. This is needed to detect cycles. When the blocker is resolved, call this again with None to clear it (the promise will then report itself as the blocker again, until resolved).

method clear_blocker : unit

r#clear_blocker removes the blocker set by set_blocker. r is then blocked by itself, if unresolved.

+struct_resolver (capnp-rpc.Capnp_rpc_proto.Message_types.Endpoint.Core_types.struct_resolver)

Class type Core_types.struct_resolver

A struct_resolver can be used to resolve some promise.

method pp : Stdlib.Format.formatter -> unit
method resolve : struct_ref -> unit

r#resolve x causes r's promise to behave as x in future. The promise takes ownership of x (is responsible for calling dec_rec on it).

method sealed_dispatch : 'a. 'a Capnp_rpc_proto__.S.brand -> 'a option

r#sealed_dispatch brand extracts some private data of the given type.

method set_blocker : base_ref -> (unit, [> `Cycle ]) Stdlib.result

r#set_blocker b means that resolve won't be called until b is resolved. r's promise should report this as its blocker. This is needed to detect cycles. When the blocker is resolved, call this again with None to clear it (the promise will then report itself as the blocker again, until resolved).

method clear_blocker : unit

r#clear_blocker removes the blocker set by set_blocker. r is then blocked by itself, if unresolved.

diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/argument-1-Core_types/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/argument-1-Core_types/index.html index c6444bcc..3a097125 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/argument-1-Core_types/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/argument-1-Core_types/index.html @@ -1,5 +1,5 @@ -Core_types (capnp-rpc.Capnp_rpc_proto.Message_types.Endpoint.Core_types)

Parameter Endpoint.Core_types

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.

module Wire : S.WIRE

The core RPC logic can be used with different serialisation systems. The appropriate types should be provided here.

type 'a or_error = ('a, Error.t) Stdlib.result
class type base_ref = object ... end

Common methods for struct_ref and cap.

val pp : base_ref Fmt.t
val inc_ref : base_ref -> unit

inc_ref x increases x's ref-count by one.

val dec_ref : base_ref -> unit

dec_ref x decreases x's ref-count by one.

class type struct_ref = object ... end

The 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 ... end

A 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 ... end

A struct_resolver can be used to resolve some promise.

module Attachments : sig ... end
module Request_payload : +Core_types (capnp-rpc.Capnp_rpc_proto.Message_types.Endpoint.Core_types)

Parameter Endpoint.Core_types

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.

module Wire : S.WIRE

The core RPC logic can be used with different serialisation systems. The appropriate types should be provided here.

type 'a or_error = ('a, Error.t) Stdlib.result
class type base_ref = object ... end

Common methods for struct_ref and cap.

val pp : base_ref Fmt.t
val inc_ref : base_ref -> unit

inc_ref x increases x's ref-count by one.

val dec_ref : base_ref -> unit

dec_ref x decreases x's ref-count by one.

class type struct_ref = object ... end

The 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 ... end

A 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 ... end

A struct_resolver can be used to resolve some promise.

module Attachments : sig ... end
module Request_payload : S.PAYLOAD with type t = Wire.Request.t and type cap := cap diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/argument-2-Network_types/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/argument-2-Network_types/index.html index 2851f1d9..5c6b6d44 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/argument-2-Network_types/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/argument-2-Network_types/index.html @@ -1,2 +1,2 @@ -Network_types (capnp-rpc.Capnp_rpc_proto.Message_types.Endpoint.Network_types)

Parameter Endpoint.Network_types

type provision_id
type recipient_id
type third_party_cap_id
type join_key_part
+Network_types (capnp-rpc.Capnp_rpc_proto.Message_types.Endpoint.Network_types)

Parameter Endpoint.Network_types

type provision_id
type recipient_id
type third_party_cap_id
type join_key_part
diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/argument-3-Table/AnswerId/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/argument-3-Table/AnswerId/index.html index 15bf4cc0..186dd2f7 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/argument-3-Table/AnswerId/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/argument-3-Table/AnswerId/index.html @@ -1,2 +1,2 @@ -AnswerId (capnp-rpc.Capnp_rpc_proto.Message_types.Endpoint.Table.AnswerId)

Module Table.AnswerId

type t = private Stdint.Uint32.t
val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
+AnswerId (capnp-rpc.Capnp_rpc_proto.Message_types.Endpoint.Table.AnswerId)

Module Table.AnswerId

type t = private Stdint.Uint32.t
val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/argument-3-Table/ExportId/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/argument-3-Table/ExportId/index.html index 545c6406..ce8e00c7 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/argument-3-Table/ExportId/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/argument-3-Table/ExportId/index.html @@ -1,2 +1,2 @@ -ExportId (capnp-rpc.Capnp_rpc_proto.Message_types.Endpoint.Table.ExportId)

Module Table.ExportId

type t = private Stdint.Uint32.t
val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
+ExportId (capnp-rpc.Capnp_rpc_proto.Message_types.Endpoint.Table.ExportId)

Module Table.ExportId

type t = private Stdint.Uint32.t
val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/argument-3-Table/ImportId/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/argument-3-Table/ImportId/index.html index bcb0cafb..fcf290f7 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/argument-3-Table/ImportId/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/argument-3-Table/ImportId/index.html @@ -1,2 +1,2 @@ -ImportId (capnp-rpc.Capnp_rpc_proto.Message_types.Endpoint.Table.ImportId)

Module Table.ImportId

type t = private Stdint.Uint32.t
val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
+ImportId (capnp-rpc.Capnp_rpc_proto.Message_types.Endpoint.Table.ImportId)

Module Table.ImportId

type t = private Stdint.Uint32.t
val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/argument-3-Table/QuestionId/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/argument-3-Table/QuestionId/index.html index 655c19c3..51426fbe 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/argument-3-Table/QuestionId/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/argument-3-Table/QuestionId/index.html @@ -1,2 +1,2 @@ -QuestionId (capnp-rpc.Capnp_rpc_proto.Message_types.Endpoint.Table.QuestionId)

Module Table.QuestionId

type t = private Stdint.Uint32.t
val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
+QuestionId (capnp-rpc.Capnp_rpc_proto.Message_types.Endpoint.Table.QuestionId)

Module Table.QuestionId

type t = private Stdint.Uint32.t
val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/argument-3-Table/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/argument-3-Table/index.html index bd02f27f..cca3e9a1 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/argument-3-Table/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/argument-3-Table/index.html @@ -1,2 +1,2 @@ -Table (capnp-rpc.Capnp_rpc_proto.Message_types.Endpoint.Table)

Parameter Endpoint.Table

For the unit tests it is convenient to pass in the types of table indexes. This allows the tests to make both ends of a connection, with the types matched up.

module QuestionId : Id.S
module AnswerId : Id.S
module ImportId : Id.S
module ExportId : Id.S
+Table (capnp-rpc.Capnp_rpc_proto.Message_types.Endpoint.Table)

Parameter Endpoint.Table

For the unit tests it is convenient to pass in the types of table indexes. This allows the tests to make both ends of a connection, with the types matched up.

module QuestionId : Id.S
module AnswerId : Id.S
module ImportId : Id.S
module ExportId : Id.S
diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/index.html index b2ffd615..7e6a7caa 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/Endpoint/index.html @@ -1,2 +1,2 @@ -Endpoint (capnp-rpc.Capnp_rpc_proto.Message_types.Endpoint)

Module Message_types.Endpoint

Parameters

Signature

module Core_types = Core_types
module Network_types = Network_types
module Table = Table
module Out : sig ... end
module In : sig ... end
+Endpoint (capnp-rpc.Capnp_rpc_proto.Message_types.Endpoint)

Module Message_types.Endpoint

Parameters

Signature

module Core_types = Core_types
module Network_types = Network_types
module Table = Table
module Out : sig ... end
module In : sig ... end
diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/Flip/argument-1-T/AnswerId/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/Flip/argument-1-T/AnswerId/index.html index d56d704f..3d700ccb 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/Flip/argument-1-T/AnswerId/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/Flip/argument-1-T/AnswerId/index.html @@ -1,2 +1,2 @@ -AnswerId (capnp-rpc.Capnp_rpc_proto.Message_types.Flip.T.AnswerId)

Module T.AnswerId

type t = private Stdint.Uint32.t
val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
+AnswerId (capnp-rpc.Capnp_rpc_proto.Message_types.Flip.T.AnswerId)

Module T.AnswerId

type t = private Stdint.Uint32.t
val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/Flip/argument-1-T/ExportId/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/Flip/argument-1-T/ExportId/index.html index b0f7a165..5e4bf07c 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/Flip/argument-1-T/ExportId/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/Flip/argument-1-T/ExportId/index.html @@ -1,2 +1,2 @@ -ExportId (capnp-rpc.Capnp_rpc_proto.Message_types.Flip.T.ExportId)

Module T.ExportId

type t = private Stdint.Uint32.t
val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
+ExportId (capnp-rpc.Capnp_rpc_proto.Message_types.Flip.T.ExportId)

Module T.ExportId

type t = private Stdint.Uint32.t
val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/Flip/argument-1-T/ImportId/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/Flip/argument-1-T/ImportId/index.html index b540b0de..85294d11 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/Flip/argument-1-T/ImportId/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/Flip/argument-1-T/ImportId/index.html @@ -1,2 +1,2 @@ -ImportId (capnp-rpc.Capnp_rpc_proto.Message_types.Flip.T.ImportId)

Module T.ImportId

type t = private Stdint.Uint32.t
val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
+ImportId (capnp-rpc.Capnp_rpc_proto.Message_types.Flip.T.ImportId)

Module T.ImportId

type t = private Stdint.Uint32.t
val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/Flip/argument-1-T/QuestionId/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/Flip/argument-1-T/QuestionId/index.html index fc572029..693a7804 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/Flip/argument-1-T/QuestionId/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/Flip/argument-1-T/QuestionId/index.html @@ -1,2 +1,2 @@ -QuestionId (capnp-rpc.Capnp_rpc_proto.Message_types.Flip.T.QuestionId)

Module T.QuestionId

type t = private Stdint.Uint32.t
val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
+QuestionId (capnp-rpc.Capnp_rpc_proto.Message_types.Flip.T.QuestionId)

Module T.QuestionId

type t = private Stdint.Uint32.t
val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/Flip/argument-1-T/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/Flip/argument-1-T/index.html index 94d9ccff..54210c55 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/Flip/argument-1-T/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/Flip/argument-1-T/index.html @@ -1,2 +1,2 @@ -T (capnp-rpc.Capnp_rpc_proto.Message_types.Flip.T)

Parameter Flip.T

For the unit tests it is convenient to pass in the types of table indexes. This allows the tests to make both ends of a connection, with the types matched up.

module QuestionId : Id.S
module AnswerId : Id.S
module ImportId : Id.S
module ExportId : Id.S
+T (capnp-rpc.Capnp_rpc_proto.Message_types.Flip.T)

Parameter Flip.T

For the unit tests it is convenient to pass in the types of table indexes. This allows the tests to make both ends of a connection, with the types matched up.

module QuestionId : Id.S
module AnswerId : Id.S
module ImportId : Id.S
module ExportId : Id.S
diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/Flip/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/Flip/index.html index 260d179c..d9bd5647 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/Flip/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/Flip/index.html @@ -1,2 +1,2 @@ -Flip (capnp-rpc.Capnp_rpc_proto.Message_types.Flip)

Module Message_types.Flip

Flip T is the types for the other end of T's connection.

Parameters

module T : TABLE_TYPES

Signature

module QuestionId = T.AnswerId
module AnswerId = T.QuestionId
module ImportId = T.ExportId
module ExportId = T.ImportId
+Flip (capnp-rpc.Capnp_rpc_proto.Message_types.Flip)

Module Message_types.Flip

Flip T is the types for the other end of T's connection.

Parameters

module T : TABLE_TYPES

Signature

module QuestionId = T.AnswerId
module AnswerId = T.QuestionId
module ImportId = T.ExportId
module ExportId = T.ImportId
diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/Make/argument-1-Core_types/Attachments/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/Make/argument-1-Core_types/Attachments/index.html index c8b67f9c..845303cf 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/Make/argument-1-Core_types/Attachments/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/Make/argument-1-Core_types/Attachments/index.html @@ -1,2 +1,2 @@ -Attachments (capnp-rpc.Capnp_rpc_proto.Message_types.Make.Core_types.Attachments)

Module Core_types.Attachments

val builder : unit -> S.attachments

builder () is a fresh writable attachments array.

val cap : int -> S.attachments -> cap

cap i t is the capability at index i in t. The reference count is increased by one.

val clear_cap : S.attachments -> int -> unit

Replace cap at index i with null and dec_ref it.

val add_cap : S.attachments -> cap -> int

add_cap t cap stores cap in t. t must have been created by builder. Increases the ref-count on cap by one.

val release_caps : S.attachments -> unit

release_caps a decreases the ref-count of every capability in a.

+Attachments (capnp-rpc.Capnp_rpc_proto.Message_types.Make.Core_types.Attachments)

Module Core_types.Attachments

val builder : unit -> S.attachments

builder () is a fresh writable attachments array.

val cap : int -> S.attachments -> cap

cap i t is the capability at index i in t. The reference count is increased by one.

val clear_cap : S.attachments -> int -> unit

Replace cap at index i with null and dec_ref it.

val add_cap : S.attachments -> cap -> int

add_cap t cap stores cap in t. t must have been created by builder. Increases the ref-count on cap by one.

val release_caps : S.attachments -> unit

release_caps a decreases the ref-count of every capability in a.

diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/Make/argument-1-Core_types/Request_payload/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/Make/argument-1-Core_types/Request_payload/index.html index 667dc412..e5358d81 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/Make/argument-1-Core_types/Request_payload/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/Make/argument-1-Core_types/Request_payload/index.html @@ -1,2 +1,2 @@ -Request_payload (capnp-rpc.Capnp_rpc_proto.Message_types.Make.Core_types.Request_payload)

Module Core_types.Request_payload

The payload of a request message.

Wraps WIRE_PAYLOAD to deal with caps rather than attachments.

val snapshot_caps : t -> cap RO_array.t
val field : t -> Wire.Path.t -> cap option

field t path looks up path in the message and returns the capability at that index. Returns None if the field wasn't set. Returns a broken capability if an index was given but does not exist (i.e. the message is corrupted). Increases the ref-count on the result.

val with_caps : cap RO_array.t -> t -> t

with_caps caps t is a copy of t with a new set of capabilities. This is useful to implement TakeFromOtherQuestion, where the message is the same but embargoes may be needed, and to break cycles.

val release : t -> unit

release t frees all the capabilities attached to this message. It is safe to call this multiple times; only the first call has any effect.

val pp : t Fmt.t
+Request_payload (capnp-rpc.Capnp_rpc_proto.Message_types.Make.Core_types.Request_payload)

Module Core_types.Request_payload

The payload of a request message.

Wraps WIRE_PAYLOAD to deal with caps rather than attachments.

val snapshot_caps : t -> cap RO_array.t
val field : t -> Wire.Path.t -> cap option

field t path looks up path in the message and returns the capability at that index. Returns None if the field wasn't set. Returns a broken capability if an index was given but does not exist (i.e. the message is corrupted). Increases the ref-count on the result.

val with_caps : cap RO_array.t -> t -> t

with_caps caps t is a copy of t with a new set of capabilities. This is useful to implement TakeFromOtherQuestion, where the message is the same but embargoes may be needed, and to break cycles.

val release : t -> unit

release t frees all the capabilities attached to this message. It is safe to call this multiple times; only the first call has any effect.

val pp : t Fmt.t
diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/Make/argument-1-Core_types/Response_payload/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/Make/argument-1-Core_types/Response_payload/index.html index 0221927d..be20d659 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/Make/argument-1-Core_types/Response_payload/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/Make/argument-1-Core_types/Response_payload/index.html @@ -1,2 +1,2 @@ -Response_payload (capnp-rpc.Capnp_rpc_proto.Message_types.Make.Core_types.Response_payload)

Module Core_types.Response_payload

The payload of a response message.

Wraps WIRE_PAYLOAD to deal with caps rather than attachments.

val snapshot_caps : t -> cap RO_array.t
val field : t -> Wire.Path.t -> cap option

field t path looks up path in the message and returns the capability at that index. Returns None if the field wasn't set. Returns a broken capability if an index was given but does not exist (i.e. the message is corrupted). Increases the ref-count on the result.

val with_caps : cap RO_array.t -> t -> t

with_caps caps t is a copy of t with a new set of capabilities. This is useful to implement TakeFromOtherQuestion, where the message is the same but embargoes may be needed, and to break cycles.

val release : t -> unit

release t frees all the capabilities attached to this message. It is safe to call this multiple times; only the first call has any effect.

val pp : t Fmt.t
+Response_payload (capnp-rpc.Capnp_rpc_proto.Message_types.Make.Core_types.Response_payload)

Module Core_types.Response_payload

The payload of a response message.

Wraps WIRE_PAYLOAD to deal with caps rather than attachments.

val snapshot_caps : t -> cap RO_array.t
val field : t -> Wire.Path.t -> cap option

field t path looks up path in the message and returns the capability at that index. Returns None if the field wasn't set. Returns a broken capability if an index was given but does not exist (i.e. the message is corrupted). Increases the ref-count on the result.

val with_caps : cap RO_array.t -> t -> t

with_caps caps t is a copy of t with a new set of capabilities. This is useful to implement TakeFromOtherQuestion, where the message is the same but embargoes may be needed, and to break cycles.

val release : t -> unit

release t frees all the capabilities attached to this message. It is safe to call this multiple times; only the first call has any effect.

val pp : t Fmt.t
diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/Make/argument-1-Core_types/Wire/Path/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/Make/argument-1-Core_types/Wire/Path/index.html index 2a442620..f473c12f 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/Make/argument-1-Core_types/Wire/Path/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/Make/argument-1-Core_types/Wire/Path/index.html @@ -1,2 +1,2 @@ -Path (capnp-rpc.Capnp_rpc_proto.Message_types.Make.Core_types.Wire.Path)

Module Wire.Path

A field in a message that refers to a capability.

include Stdlib.Map.OrderedType
type t
val compare : t -> t -> int
val root : t

The path for the bootstrap capability in the bootstrap message.

val pp : t Fmt.t
+Path (capnp-rpc.Capnp_rpc_proto.Message_types.Make.Core_types.Wire.Path)

Module Wire.Path

A field in a message that refers to a capability.

include Stdlib.Map.OrderedType
type t
val compare : t -> t -> int
val root : t

The path for the bootstrap capability in the bootstrap message.

val pp : t Fmt.t
diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/Make/argument-1-Core_types/Wire/Request/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/Make/argument-1-Core_types/Wire/Request/index.html index 2064f0d1..87d8d821 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/Make/argument-1-Core_types/Wire/Request/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/Make/argument-1-Core_types/Wire/Request/index.html @@ -1,2 +1,2 @@ -Request (capnp-rpc.Capnp_rpc_proto.Message_types.Make.Core_types.Wire.Request)

Module Wire.Request

type t = request msg

A message payload. This is typically a byte array of some kind, plus a way of attaching capabilities.

val pp : t Fmt.t
val cap_index : t -> Path.t -> int option

cap_index msg path is the capability index at path in the message (i.e the index of the capability in the attachments table).

val attachments : t -> S.attachments
val with_attachments : S.attachments -> t -> t
+Request (capnp-rpc.Capnp_rpc_proto.Message_types.Make.Core_types.Wire.Request)

Module Wire.Request

type t = request msg

A message payload. This is typically a byte array of some kind, plus a way of attaching capabilities.

val pp : t Fmt.t
val cap_index : t -> Path.t -> int option

cap_index msg path is the capability index at path in the message (i.e the index of the capability in the attachments table).

val attachments : t -> S.attachments
val with_attachments : S.attachments -> t -> t
diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/Make/argument-1-Core_types/Wire/Response/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/Make/argument-1-Core_types/Wire/Response/index.html index e1282725..a0a4a216 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/Make/argument-1-Core_types/Wire/Response/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/Make/argument-1-Core_types/Wire/Response/index.html @@ -1,2 +1,2 @@ -Response (capnp-rpc.Capnp_rpc_proto.Message_types.Make.Core_types.Wire.Response)

Module Wire.Response

include S.WIRE_PAYLOAD with type t = response msg and type path := Path.t
type t = response msg

A message payload. This is typically a byte array of some kind, plus a way of attaching capabilities.

val pp : t Fmt.t
val cap_index : t -> Path.t -> int option

cap_index msg path is the capability index at path in the message (i.e the index of the capability in the attachments table).

val attachments : t -> S.attachments
val with_attachments : S.attachments -> t -> t
val bootstrap : unit -> t

The (empty) content for the reply to the bootstrap message.

+Response (capnp-rpc.Capnp_rpc_proto.Message_types.Make.Core_types.Wire.Response)

Module Wire.Response

include S.WIRE_PAYLOAD with type t = response msg and type path := Path.t
type t = response msg

A message payload. This is typically a byte array of some kind, plus a way of attaching capabilities.

val pp : t Fmt.t
val cap_index : t -> Path.t -> int option

cap_index msg path is the capability index at path in the message (i.e the index of the capability in the attachments table).

val attachments : t -> S.attachments
val with_attachments : S.attachments -> t -> t
val bootstrap : unit -> t

The (empty) content for the reply to the bootstrap message.

diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/Make/argument-1-Core_types/Wire/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/Make/argument-1-Core_types/Wire/index.html index f6dc3b95..6fe4c369 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/Make/argument-1-Core_types/Wire/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/Make/argument-1-Core_types/Wire/index.html @@ -1,3 +1,3 @@ -Wire (capnp-rpc.Capnp_rpc_proto.Message_types.Make.Core_types.Wire)

Module Core_types.Wire

The core RPC logic can be used with different serialisation systems. The appropriate types should be provided here.

type request
type response
type 'a msg
module Path : sig ... end

A field in a message that refers to a capability.

module Request : +Wire (capnp-rpc.Capnp_rpc_proto.Message_types.Make.Core_types.Wire)

Module Core_types.Wire

The core RPC logic can be used with different serialisation systems. The appropriate types should be provided here.

type request
type response
type 'a msg
module Path : sig ... end

A field in a message that refers to a capability.

module Request : S.WIRE_PAYLOAD with type t = request msg and type path := Path.t
module Response : sig ... end
val ref_leak_detected : int -> (unit -> unit) -> unit

ref_leak_detected thread_id fn is called when a promise or capability is GC'd while its ref-count is non-zero, indicating that resources may have been leaked. fn () will log a warning about this and free the resources itself. The reason for going via ref_leak_detected rather than calling fn directly is because the OCaml GC may detect the problem at any point (e.g. while we're sending another message). The implementation should arrange for fn to be called at a safe point in thread thread_id (e.g. when returning to the thread's main loop). Unit-tests may wish to call fn immediately to show the error and then fail the test.

diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/Make/argument-1-Core_types/class-ref_counted/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/Make/argument-1-Core_types/class-ref_counted/index.html index 1afcb235..e2f762d5 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/Make/argument-1-Core_types/class-ref_counted/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/Make/argument-1-Core_types/class-ref_counted/index.html @@ -1,2 +1,2 @@ -ref_counted (capnp-rpc.Capnp_rpc_proto.Message_types.Make.Core_types.ref_counted)

Class Core_types.ref_counted

A mix-in to help with writing reference-counted objects. It will call self#release when the ref-count reaches zero.

method private virtual release : unit
method virtual pp : Stdlib.Format.formatter -> unit
method private pp_refcount : Stdlib.Format.formatter -> unit

Write the current ref-count to the formatter (use with "%t").

method private check_refcount : unit

Raise an exception if the ref-count is less than one (i.e. check that the object hasn't already been freed).

method update_rc : int -> unit
method check_invariants : unit
method virtual blocker : base_ref option
method sealed_dispatch : 'a. 'a Capnp_rpc_proto__.S.brand -> 'a option
+ref_counted (capnp-rpc.Capnp_rpc_proto.Message_types.Make.Core_types.ref_counted)

Class Core_types.ref_counted

A mix-in to help with writing reference-counted objects. It will call self#release when the ref-count reaches zero.

method private virtual release : unit
method virtual pp : Stdlib.Format.formatter -> unit
method private pp_refcount : Stdlib.Format.formatter -> unit

Write the current ref-count to the formatter (use with "%t").

method private check_refcount : unit

Raise an exception if the ref-count is less than one (i.e. check that the object hasn't already been freed).

method update_rc : int -> unit
method check_invariants : unit
method virtual blocker : base_ref option
method sealed_dispatch : 'a. 'a Capnp_rpc_proto__.S.brand -> 'a option
diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/Make/argument-1-Core_types/class-service/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/Make/argument-1-Core_types/class-service/index.html index 49327b30..5d9c07e2 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/Make/argument-1-Core_types/class-service/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/Make/argument-1-Core_types/class-service/index.html @@ -1,2 +1,2 @@ -service (capnp-rpc.Capnp_rpc_proto.Message_types.Make.Core_types.service)

Class Core_types.service

A convenience base class for creating local services. The capability is always resolved, and the default release method does nothing.

inherit base_ref
inherit ref_counted
method virtual call : struct_resolver -> Wire.Request.t -> unit
method shortest : cap
method private release : unit
method when_more_resolved : (cap -> unit) -> unit
method when_released : (unit -> unit) -> unit
method problem : Capnp_rpc_proto__.Exception.t option
+service (capnp-rpc.Capnp_rpc_proto.Message_types.Make.Core_types.service)

Class Core_types.service

A convenience base class for creating local services. The capability is always resolved, and the default release method does nothing.

inherit base_ref
inherit ref_counted
method virtual call : struct_resolver -> Wire.Request.t -> unit
method shortest : cap
method private release : unit
method when_more_resolved : (cap -> unit) -> unit
method when_released : (unit -> unit) -> unit
method problem : Capnp_rpc_proto__.Exception.t option
diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/Make/argument-1-Core_types/class-type-base_ref/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/Make/argument-1-Core_types/class-type-base_ref/index.html index 161e76b8..c8dcdb1a 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/Make/argument-1-Core_types/class-type-base_ref/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/Make/argument-1-Core_types/class-type-base_ref/index.html @@ -1,2 +1,2 @@ -base_ref (capnp-rpc.Capnp_rpc_proto.Message_types.Make.Core_types.base_ref)

Class type Core_types.base_ref

Common methods for struct_ref and cap.

method pp : Stdlib.Format.formatter -> unit
method update_rc : int -> unit

c#update_rc d adds d to c's (local) reference count. When it reaches zero, c must not be used again. A message may be sent releasing any remote resources.

method blocker : base_ref option

c#blocker is the unresolved cap or struct_ref promise that must resolve for c to resolve. This is used to help detect cycles.

method check_invariants : unit

This is for debugging. Checks its own invariants and those of other base_refs it holds. Raises Invariant_broken if there is a problem.

method sealed_dispatch : 'a. 'a Capnp_rpc_proto__.S.brand -> 'a option

c#sealed_dispatch brand extracts some private data of the given type.

+base_ref (capnp-rpc.Capnp_rpc_proto.Message_types.Make.Core_types.base_ref)

Class type Core_types.base_ref

Common methods for struct_ref and cap.

method pp : Stdlib.Format.formatter -> unit
method update_rc : int -> unit

c#update_rc d adds d to c's (local) reference count. When it reaches zero, c must not be used again. A message may be sent releasing any remote resources.

method blocker : base_ref option

c#blocker is the unresolved cap or struct_ref promise that must resolve for c to resolve. This is used to help detect cycles.

method check_invariants : unit

This is for debugging. Checks its own invariants and those of other base_refs it holds. Raises Invariant_broken if there is a problem.

method sealed_dispatch : 'a. 'a Capnp_rpc_proto__.S.brand -> 'a option

c#sealed_dispatch brand extracts some private data of the given type.

diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/Make/argument-1-Core_types/class-type-cap/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/Make/argument-1-Core_types/class-type-cap/index.html index 0feed4a8..38f43e23 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/Make/argument-1-Core_types/class-type-cap/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/Make/argument-1-Core_types/class-type-cap/index.html @@ -1,2 +1,2 @@ -cap (capnp-rpc.Capnp_rpc_proto.Message_types.Make.Core_types.cap)

Class type Core_types.cap

A 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.

inherit base_ref
method call : struct_resolver -> Wire.Request.t -> unit

c#call results msg invokes a method on c's target and eventually resolves results with the answer.

method shortest : cap

c#shortest is the shortest known path to cap. i.e. if c is forwarding to another cap, we return that, recursively.

method when_more_resolved : (cap -> unit) -> unit

c#when_more_resolved fn calls fn x when this cap becomes more resolved. fn x gets a reference to x and needs to dec_ref it. Note that the new capability can be another promise. If c is already resolved to its final value, this does nothing. If c is a far-ref, fn x will be called when it breaks. If c is forwarding to another cap, it will forward this call. If c gets released before calling fn, it will never call it.

method when_released : (unit -> unit) -> unit

c#when_released fn will call fn () when c's ref-count drops to zero. This is used for caches, to remove entries when they become invalid. For promises, fn will be transferred to the resolution if resolved. For broken caps, this method does nothing (exceptions are never released).

method problem : Capnp_rpc_proto__.Exception.t option

c#problem is the exception for a broken reference, or None if it is not known to be broken.

+cap (capnp-rpc.Capnp_rpc_proto.Message_types.Make.Core_types.cap)

Class type Core_types.cap

A 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.

inherit base_ref
method call : struct_resolver -> Wire.Request.t -> unit

c#call results msg invokes a method on c's target and eventually resolves results with the answer.

method shortest : cap

c#shortest is the shortest known path to cap. i.e. if c is forwarding to another cap, we return that, recursively.

method when_more_resolved : (cap -> unit) -> unit

c#when_more_resolved fn calls fn x when this cap becomes more resolved. fn x gets a reference to x and needs to dec_ref it. Note that the new capability can be another promise. If c is already resolved to its final value, this does nothing. If c is a far-ref, fn x will be called when it breaks. If c is forwarding to another cap, it will forward this call. If c gets released before calling fn, it will never call it.

method when_released : (unit -> unit) -> unit

c#when_released fn will call fn () when c's ref-count drops to zero. This is used for caches, to remove entries when they become invalid. For promises, fn will be transferred to the resolution if resolved. For broken caps, this method does nothing (exceptions are never released).

method problem : Capnp_rpc_proto__.Exception.t option

c#problem is the exception for a broken reference, or None if it is not known to be broken.

diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/Make/argument-1-Core_types/class-type-struct_ref/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/Make/argument-1-Core_types/class-type-struct_ref/index.html index a3454270..60d84430 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/Make/argument-1-Core_types/class-type-struct_ref/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/Make/argument-1-Core_types/class-type-struct_ref/index.html @@ -1,2 +1,2 @@ -struct_ref (capnp-rpc.Capnp_rpc_proto.Message_types.Make.Core_types.struct_ref)

Class type Core_types.struct_ref

The 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.

inherit base_ref
method when_resolved : (Wire.Response.t or_error -> unit) -> unit

r#when_resolved fn queues up fn to be called on the result, when it arrives. If the result has already arrived, fn is called immediately.

method response : Wire.Response.t or_error option

r#response is Some payload if the response has arrived, or None if we're still waiting.

method cap : Wire.Path.t -> cap

r#cap path is the capability found at path in the response. If the response has arrived, this will extract the capability from it. If not, it may create a capability that will pipeline through the promised answer until the result arrives (at which point it will use the new, more direct route). The caller should call cap#dec_ref when done.

+struct_ref (capnp-rpc.Capnp_rpc_proto.Message_types.Make.Core_types.struct_ref)

Class type Core_types.struct_ref

The 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.

inherit base_ref
method when_resolved : (Wire.Response.t or_error -> unit) -> unit

r#when_resolved fn queues up fn to be called on the result, when it arrives. If the result has already arrived, fn is called immediately.

method response : Wire.Response.t or_error option

r#response is Some payload if the response has arrived, or None if we're still waiting.

method cap : Wire.Path.t -> cap

r#cap path is the capability found at path in the response. If the response has arrived, this will extract the capability from it. If not, it may create a capability that will pipeline through the promised answer until the result arrives (at which point it will use the new, more direct route). The caller should call cap#dec_ref when done.

diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/Make/argument-1-Core_types/class-type-struct_resolver/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/Make/argument-1-Core_types/class-type-struct_resolver/index.html index e4370c2b..14f1b638 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/Make/argument-1-Core_types/class-type-struct_resolver/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/Make/argument-1-Core_types/class-type-struct_resolver/index.html @@ -1,2 +1,2 @@ -struct_resolver (capnp-rpc.Capnp_rpc_proto.Message_types.Make.Core_types.struct_resolver)

Class type Core_types.struct_resolver

A struct_resolver can be used to resolve some promise.

method pp : Stdlib.Format.formatter -> unit
method resolve : struct_ref -> unit

r#resolve x causes r's promise to behave as x in future. The promise takes ownership of x (is responsible for calling dec_rec on it).

method sealed_dispatch : 'a. 'a Capnp_rpc_proto__.S.brand -> 'a option

r#sealed_dispatch brand extracts some private data of the given type.

method set_blocker : base_ref -> (unit, [> `Cycle ]) Stdlib.result

r#set_blocker b means that resolve won't be called until b is resolved. r's promise should report this as its blocker. This is needed to detect cycles. When the blocker is resolved, call this again with None to clear it (the promise will then report itself as the blocker again, until resolved).

method clear_blocker : unit

r#clear_blocker removes the blocker set by set_blocker. r is then blocked by itself, if unresolved.

+struct_resolver (capnp-rpc.Capnp_rpc_proto.Message_types.Make.Core_types.struct_resolver)

Class type Core_types.struct_resolver

A struct_resolver can be used to resolve some promise.

method pp : Stdlib.Format.formatter -> unit
method resolve : struct_ref -> unit

r#resolve x causes r's promise to behave as x in future. The promise takes ownership of x (is responsible for calling dec_rec on it).

method sealed_dispatch : 'a. 'a Capnp_rpc_proto__.S.brand -> 'a option

r#sealed_dispatch brand extracts some private data of the given type.

method set_blocker : base_ref -> (unit, [> `Cycle ]) Stdlib.result

r#set_blocker b means that resolve won't be called until b is resolved. r's promise should report this as its blocker. This is needed to detect cycles. When the blocker is resolved, call this again with None to clear it (the promise will then report itself as the blocker again, until resolved).

method clear_blocker : unit

r#clear_blocker removes the blocker set by set_blocker. r is then blocked by itself, if unresolved.

diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/Make/argument-1-Core_types/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/Make/argument-1-Core_types/index.html index 4c16c09c..18f7ab30 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/Make/argument-1-Core_types/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/Make/argument-1-Core_types/index.html @@ -1,5 +1,5 @@ -Core_types (capnp-rpc.Capnp_rpc_proto.Message_types.Make.Core_types)

Parameter Make.Core_types

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.

module Wire : S.WIRE

The core RPC logic can be used with different serialisation systems. The appropriate types should be provided here.

type 'a or_error = ('a, Error.t) Stdlib.result
class type base_ref = object ... end

Common methods for struct_ref and cap.

val pp : base_ref Fmt.t
val inc_ref : base_ref -> unit

inc_ref x increases x's ref-count by one.

val dec_ref : base_ref -> unit

dec_ref x decreases x's ref-count by one.

class type struct_ref = object ... end

The 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 ... end

A 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 ... end

A struct_resolver can be used to resolve some promise.

module Attachments : sig ... end
module Request_payload : +Core_types (capnp-rpc.Capnp_rpc_proto.Message_types.Make.Core_types)

Parameter Make.Core_types

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.

module Wire : S.WIRE

The core RPC logic can be used with different serialisation systems. The appropriate types should be provided here.

type 'a or_error = ('a, Error.t) Stdlib.result
class type base_ref = object ... end

Common methods for struct_ref and cap.

val pp : base_ref Fmt.t
val inc_ref : base_ref -> unit

inc_ref x increases x's ref-count by one.

val dec_ref : base_ref -> unit

dec_ref x decreases x's ref-count by one.

class type struct_ref = object ... end

The 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 ... end

A 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 ... end

A struct_resolver can be used to resolve some promise.

module Attachments : sig ... end
module Request_payload : S.PAYLOAD with type t = Wire.Request.t and type cap := cap diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/Make/argument-2-Network/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/Make/argument-2-Network/index.html index ba6dc094..c1114a7a 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/Make/argument-2-Network/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/Make/argument-2-Network/index.html @@ -1,2 +1,2 @@ -Network (capnp-rpc.Capnp_rpc_proto.Message_types.Make.Network)

Parameter Make.Network

type provision_id
type recipient_id
type third_party_cap_id
type join_key_part
+Network (capnp-rpc.Capnp_rpc_proto.Message_types.Make.Network)

Parameter Make.Network

type provision_id
type recipient_id
type third_party_cap_id
type join_key_part
diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/Make/argument-3-T/AnswerId/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/Make/argument-3-T/AnswerId/index.html index 37014228..f884645b 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/Make/argument-3-T/AnswerId/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/Make/argument-3-T/AnswerId/index.html @@ -1,2 +1,2 @@ -AnswerId (capnp-rpc.Capnp_rpc_proto.Message_types.Make.T.AnswerId)

Module T.AnswerId

type t = private Stdint.Uint32.t
val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
+AnswerId (capnp-rpc.Capnp_rpc_proto.Message_types.Make.T.AnswerId)

Module T.AnswerId

type t = private Stdint.Uint32.t
val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/Make/argument-3-T/ExportId/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/Make/argument-3-T/ExportId/index.html index 46d34907..52dd1738 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/Make/argument-3-T/ExportId/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/Make/argument-3-T/ExportId/index.html @@ -1,2 +1,2 @@ -ExportId (capnp-rpc.Capnp_rpc_proto.Message_types.Make.T.ExportId)

Module T.ExportId

type t = private Stdint.Uint32.t
val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
+ExportId (capnp-rpc.Capnp_rpc_proto.Message_types.Make.T.ExportId)

Module T.ExportId

type t = private Stdint.Uint32.t
val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/Make/argument-3-T/ImportId/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/Make/argument-3-T/ImportId/index.html index d6319040..a1a32a64 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/Make/argument-3-T/ImportId/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/Make/argument-3-T/ImportId/index.html @@ -1,2 +1,2 @@ -ImportId (capnp-rpc.Capnp_rpc_proto.Message_types.Make.T.ImportId)

Module T.ImportId

type t = private Stdint.Uint32.t
val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
+ImportId (capnp-rpc.Capnp_rpc_proto.Message_types.Make.T.ImportId)

Module T.ImportId

type t = private Stdint.Uint32.t
val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/Make/argument-3-T/QuestionId/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/Make/argument-3-T/QuestionId/index.html index 68125910..c8d10880 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/Make/argument-3-T/QuestionId/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/Make/argument-3-T/QuestionId/index.html @@ -1,2 +1,2 @@ -QuestionId (capnp-rpc.Capnp_rpc_proto.Message_types.Make.T.QuestionId)

Module T.QuestionId

type t = private Stdint.Uint32.t
val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
+QuestionId (capnp-rpc.Capnp_rpc_proto.Message_types.Make.T.QuestionId)

Module T.QuestionId

type t = private Stdint.Uint32.t
val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/Make/argument-3-T/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/Make/argument-3-T/index.html index 138a133e..a69845a3 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/Make/argument-3-T/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/Make/argument-3-T/index.html @@ -1,2 +1,2 @@ -T (capnp-rpc.Capnp_rpc_proto.Message_types.Make.T)

Parameter Make.T

For the unit tests it is convenient to pass in the types of table indexes. This allows the tests to make both ends of a connection, with the types matched up.

module QuestionId : Id.S
module AnswerId : Id.S
module ImportId : Id.S
module ExportId : Id.S
+T (capnp-rpc.Capnp_rpc_proto.Message_types.Make.T)

Parameter Make.T

For the unit tests it is convenient to pass in the types of table indexes. This allows the tests to make both ends of a connection, with the types matched up.

module QuestionId : Id.S
module AnswerId : Id.S
module ImportId : Id.S
module ExportId : Id.S
diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/Make/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/Make/index.html index fce9ce1c..7443fb67 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/Make/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/Make/index.html @@ -1,5 +1,5 @@ -Make (capnp-rpc.Capnp_rpc_proto.Message_types.Make)

Module Message_types.Make

This module defines the information in the messages that goes over the wire in one direction. The types are from the point of view of the sender, as in the Cap'n Proto RPC specification.

Parameters

module T : TABLE_TYPES

Signature

include module type of struct include T end
module QuestionId = T.QuestionId
module AnswerId = T.AnswerId
module ImportId = T.ImportId
module ExportId = T.ExportId
type third_party_desc = Network.third_party_cap_id * ExportId.t
type message_target = [
  1. | `ReceiverHosted of ImportId.t
  2. | `ReceiverAnswer of QuestionId.t * Core_types.Wire.Path.t
]
type desc = [
  1. | message_target
  2. | `None
  3. | `SenderHosted of ExportId.t
  4. | `SenderPromise of ExportId.t
  5. | `ThirdPartyHosted of third_party_desc
]
val pp_desc : +Make (capnp-rpc.Capnp_rpc_proto.Message_types.Make)

Module Message_types.Make

This module defines the information in the messages that goes over the wire in one direction. The types are from the point of view of the sender, as in the Cap'n Proto RPC specification.

Parameters

module T : TABLE_TYPES

Signature

include module type of struct include T end
module QuestionId = T.QuestionId
module AnswerId = T.AnswerId
module ImportId = T.ImportId
module ExportId = T.ExportId
type third_party_desc = Network.third_party_cap_id * ExportId.t
type message_target = [
  1. | `ReceiverHosted of ImportId.t
  2. | `ReceiverAnswer of QuestionId.t * Core_types.Wire.Path.t
]
type desc = [
  1. | message_target
  2. | `None
  3. | `SenderHosted of ExportId.t
  4. | `SenderPromise of ExportId.t
  5. | `ThirdPartyHosted of third_party_desc
]
val pp_desc : Stdlib.Format.formatter -> [< `Local of < pp : Stdlib.Format.formatter -> unit.. > | `None diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/Table_types/AnswerId/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/Table_types/AnswerId/index.html index 4d04c5c7..916bf6c1 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/Table_types/AnswerId/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/Table_types/AnswerId/index.html @@ -1,2 +1,2 @@ -AnswerId (capnp-rpc.Capnp_rpc_proto.Message_types.Table_types.AnswerId)

Module Table_types.AnswerId

type t = private Stdint.Uint32.t
val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
+AnswerId (capnp-rpc.Capnp_rpc_proto.Message_types.Table_types.AnswerId)

Module Table_types.AnswerId

type t = private Stdint.Uint32.t
val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/Table_types/ExportId/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/Table_types/ExportId/index.html index a39d5a8e..d705c9a9 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/Table_types/ExportId/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/Table_types/ExportId/index.html @@ -1,2 +1,2 @@ -ExportId (capnp-rpc.Capnp_rpc_proto.Message_types.Table_types.ExportId)

Module Table_types.ExportId

type t = private Stdint.Uint32.t
val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
+ExportId (capnp-rpc.Capnp_rpc_proto.Message_types.Table_types.ExportId)

Module Table_types.ExportId

type t = private Stdint.Uint32.t
val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/Table_types/ImportId/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/Table_types/ImportId/index.html index 09118268..c2d63ebd 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/Table_types/ImportId/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/Table_types/ImportId/index.html @@ -1,2 +1,2 @@ -ImportId (capnp-rpc.Capnp_rpc_proto.Message_types.Table_types.ImportId)

Module Table_types.ImportId

type t = private Stdint.Uint32.t
val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
+ImportId (capnp-rpc.Capnp_rpc_proto.Message_types.Table_types.ImportId)

Module Table_types.ImportId

type t = private Stdint.Uint32.t
val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/Table_types/QuestionId/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/Table_types/QuestionId/index.html index 1dbef296..cd5b375f 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/Table_types/QuestionId/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/Table_types/QuestionId/index.html @@ -1,2 +1,2 @@ -QuestionId (capnp-rpc.Capnp_rpc_proto.Message_types.Table_types.QuestionId)

Module Table_types.QuestionId

type t = private Stdint.Uint32.t
val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
+QuestionId (capnp-rpc.Capnp_rpc_proto.Message_types.Table_types.QuestionId)

Module Table_types.QuestionId

type t = private Stdint.Uint32.t
val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/Table_types/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/Table_types/index.html index 7c3435e6..74bd3ab5 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/Table_types/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/Table_types/index.html @@ -1,2 +1,2 @@ -Table_types (capnp-rpc.Capnp_rpc_proto.Message_types.Table_types)

Module Message_types.Table_types

Parameters

Signature

module QuestionId : sig ... end
module AnswerId : sig ... end
module ImportId : sig ... end
module ExportId : sig ... end
+Table_types (capnp-rpc.Capnp_rpc_proto.Message_types.Table_types)

Module Message_types.Table_types

Parameters

Signature

module QuestionId : sig ... end
module AnswerId : sig ... end
module ImportId : sig ... end
module ExportId : sig ... end
diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/index.html index f06be554..64c80ce7 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/index.html @@ -1,5 +1,5 @@ -Message_types (capnp-rpc.Capnp_rpc_proto.Message_types)

Module Capnp_rpc_proto.Message_types

This module defines the information in the messages that goes over the wire. These messages are turned into actual byte streams elsewhere.

module EmbargoId : sig ... end
module type TABLE_TYPES = sig ... end

For the unit tests it is convenient to pass in the types of table indexes. This allows the tests to make both ends of a connection, with the types matched up.

module Flip (T : TABLE_TYPES) : sig ... end

Flip T is the types for the other end of T's connection.

module Make +Message_types (capnp-rpc.Capnp_rpc_proto.Message_types)

Module Capnp_rpc_proto.Message_types

This module defines the information in the messages that goes over the wire. These messages are turned into actual byte streams elsewhere.

module EmbargoId : sig ... end
module type TABLE_TYPES = sig ... end

For the unit tests it is convenient to pass in the types of table indexes. This allows the tests to make both ends of a connection, with the types matched up.

module Flip (T : TABLE_TYPES) : sig ... end

Flip T is the types for the other end of T's connection.

module Make (Core_types : S.CORE_TYPES) (Network : S.NETWORK_TYPES) (T : TABLE_TYPES) : diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Core_types/Attachments/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Core_types/Attachments/index.html index 2b54cc78..7bc53621 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Core_types/Attachments/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Core_types/Attachments/index.html @@ -1,2 +1,2 @@ -Attachments (capnp-rpc.Capnp_rpc_proto.Message_types.ENDPOINT.Core_types.Attachments)

Module Core_types.Attachments

val builder : unit -> S.attachments

builder () is a fresh writable attachments array.

val cap : int -> S.attachments -> cap

cap i t is the capability at index i in t. The reference count is increased by one.

val clear_cap : S.attachments -> int -> unit

Replace cap at index i with null and dec_ref it.

val add_cap : S.attachments -> cap -> int

add_cap t cap stores cap in t. t must have been created by builder. Increases the ref-count on cap by one.

val release_caps : S.attachments -> unit

release_caps a decreases the ref-count of every capability in a.

+Attachments (capnp-rpc.Capnp_rpc_proto.Message_types.ENDPOINT.Core_types.Attachments)

Module Core_types.Attachments

val builder : unit -> S.attachments

builder () is a fresh writable attachments array.

val cap : int -> S.attachments -> cap

cap i t is the capability at index i in t. The reference count is increased by one.

val clear_cap : S.attachments -> int -> unit

Replace cap at index i with null and dec_ref it.

val add_cap : S.attachments -> cap -> int

add_cap t cap stores cap in t. t must have been created by builder. Increases the ref-count on cap by one.

val release_caps : S.attachments -> unit

release_caps a decreases the ref-count of every capability in a.

diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Core_types/Request_payload/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Core_types/Request_payload/index.html index d3896615..853cfe1f 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Core_types/Request_payload/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Core_types/Request_payload/index.html @@ -1,2 +1,2 @@ -Request_payload (capnp-rpc.Capnp_rpc_proto.Message_types.ENDPOINT.Core_types.Request_payload)

Module Core_types.Request_payload

The payload of a request message.

Wraps WIRE_PAYLOAD to deal with caps rather than attachments.

val snapshot_caps : t -> cap RO_array.t
val field : t -> Wire.Path.t -> cap option

field t path looks up path in the message and returns the capability at that index. Returns None if the field wasn't set. Returns a broken capability if an index was given but does not exist (i.e. the message is corrupted). Increases the ref-count on the result.

val with_caps : cap RO_array.t -> t -> t

with_caps caps t is a copy of t with a new set of capabilities. This is useful to implement TakeFromOtherQuestion, where the message is the same but embargoes may be needed, and to break cycles.

val release : t -> unit

release t frees all the capabilities attached to this message. It is safe to call this multiple times; only the first call has any effect.

val pp : t Fmt.t
+Request_payload (capnp-rpc.Capnp_rpc_proto.Message_types.ENDPOINT.Core_types.Request_payload)

Module Core_types.Request_payload

The payload of a request message.

Wraps WIRE_PAYLOAD to deal with caps rather than attachments.

val snapshot_caps : t -> cap RO_array.t
val field : t -> Wire.Path.t -> cap option

field t path looks up path in the message and returns the capability at that index. Returns None if the field wasn't set. Returns a broken capability if an index was given but does not exist (i.e. the message is corrupted). Increases the ref-count on the result.

val with_caps : cap RO_array.t -> t -> t

with_caps caps t is a copy of t with a new set of capabilities. This is useful to implement TakeFromOtherQuestion, where the message is the same but embargoes may be needed, and to break cycles.

val release : t -> unit

release t frees all the capabilities attached to this message. It is safe to call this multiple times; only the first call has any effect.

val pp : t Fmt.t
diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Core_types/Response_payload/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Core_types/Response_payload/index.html index 20b48946..e8f0b757 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Core_types/Response_payload/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Core_types/Response_payload/index.html @@ -1,2 +1,2 @@ -Response_payload (capnp-rpc.Capnp_rpc_proto.Message_types.ENDPOINT.Core_types.Response_payload)

Module Core_types.Response_payload

The payload of a response message.

Wraps WIRE_PAYLOAD to deal with caps rather than attachments.

val snapshot_caps : t -> cap RO_array.t
val field : t -> Wire.Path.t -> cap option

field t path looks up path in the message and returns the capability at that index. Returns None if the field wasn't set. Returns a broken capability if an index was given but does not exist (i.e. the message is corrupted). Increases the ref-count on the result.

val with_caps : cap RO_array.t -> t -> t

with_caps caps t is a copy of t with a new set of capabilities. This is useful to implement TakeFromOtherQuestion, where the message is the same but embargoes may be needed, and to break cycles.

val release : t -> unit

release t frees all the capabilities attached to this message. It is safe to call this multiple times; only the first call has any effect.

val pp : t Fmt.t
+Response_payload (capnp-rpc.Capnp_rpc_proto.Message_types.ENDPOINT.Core_types.Response_payload)

Module Core_types.Response_payload

The payload of a response message.

Wraps WIRE_PAYLOAD to deal with caps rather than attachments.

val snapshot_caps : t -> cap RO_array.t
val field : t -> Wire.Path.t -> cap option

field t path looks up path in the message and returns the capability at that index. Returns None if the field wasn't set. Returns a broken capability if an index was given but does not exist (i.e. the message is corrupted). Increases the ref-count on the result.

val with_caps : cap RO_array.t -> t -> t

with_caps caps t is a copy of t with a new set of capabilities. This is useful to implement TakeFromOtherQuestion, where the message is the same but embargoes may be needed, and to break cycles.

val release : t -> unit

release t frees all the capabilities attached to this message. It is safe to call this multiple times; only the first call has any effect.

val pp : t Fmt.t
diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Core_types/Wire/Path/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Core_types/Wire/Path/index.html index f35934cc..6cf2fdb9 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Core_types/Wire/Path/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Core_types/Wire/Path/index.html @@ -1,2 +1,2 @@ -Path (capnp-rpc.Capnp_rpc_proto.Message_types.ENDPOINT.Core_types.Wire.Path)

Module Wire.Path

A field in a message that refers to a capability.

include Stdlib.Map.OrderedType
type t
val compare : t -> t -> int
val root : t

The path for the bootstrap capability in the bootstrap message.

val pp : t Fmt.t
+Path (capnp-rpc.Capnp_rpc_proto.Message_types.ENDPOINT.Core_types.Wire.Path)

Module Wire.Path

A field in a message that refers to a capability.

include Stdlib.Map.OrderedType
type t
val compare : t -> t -> int
val root : t

The path for the bootstrap capability in the bootstrap message.

val pp : t Fmt.t
diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Core_types/Wire/Request/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Core_types/Wire/Request/index.html index de07b752..a43f97a9 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Core_types/Wire/Request/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Core_types/Wire/Request/index.html @@ -1,2 +1,2 @@ -Request (capnp-rpc.Capnp_rpc_proto.Message_types.ENDPOINT.Core_types.Wire.Request)

Module Wire.Request

type t = request msg

A message payload. This is typically a byte array of some kind, plus a way of attaching capabilities.

val pp : t Fmt.t
val cap_index : t -> Path.t -> int option

cap_index msg path is the capability index at path in the message (i.e the index of the capability in the attachments table).

val attachments : t -> S.attachments
val with_attachments : S.attachments -> t -> t
+Request (capnp-rpc.Capnp_rpc_proto.Message_types.ENDPOINT.Core_types.Wire.Request)

Module Wire.Request

type t = request msg

A message payload. This is typically a byte array of some kind, plus a way of attaching capabilities.

val pp : t Fmt.t
val cap_index : t -> Path.t -> int option

cap_index msg path is the capability index at path in the message (i.e the index of the capability in the attachments table).

val attachments : t -> S.attachments
val with_attachments : S.attachments -> t -> t
diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Core_types/Wire/Response/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Core_types/Wire/Response/index.html index 0e86595d..a71b750a 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Core_types/Wire/Response/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Core_types/Wire/Response/index.html @@ -1,2 +1,2 @@ -Response (capnp-rpc.Capnp_rpc_proto.Message_types.ENDPOINT.Core_types.Wire.Response)

Module Wire.Response

include S.WIRE_PAYLOAD with type t = response msg and type path := Path.t
type t = response msg

A message payload. This is typically a byte array of some kind, plus a way of attaching capabilities.

val pp : t Fmt.t
val cap_index : t -> Path.t -> int option

cap_index msg path is the capability index at path in the message (i.e the index of the capability in the attachments table).

val attachments : t -> S.attachments
val with_attachments : S.attachments -> t -> t
val bootstrap : unit -> t

The (empty) content for the reply to the bootstrap message.

+Response (capnp-rpc.Capnp_rpc_proto.Message_types.ENDPOINT.Core_types.Wire.Response)

Module Wire.Response

include S.WIRE_PAYLOAD with type t = response msg and type path := Path.t
type t = response msg

A message payload. This is typically a byte array of some kind, plus a way of attaching capabilities.

val pp : t Fmt.t
val cap_index : t -> Path.t -> int option

cap_index msg path is the capability index at path in the message (i.e the index of the capability in the attachments table).

val attachments : t -> S.attachments
val with_attachments : S.attachments -> t -> t
val bootstrap : unit -> t

The (empty) content for the reply to the bootstrap message.

diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Core_types/Wire/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Core_types/Wire/index.html index b58b8e7d..8fe70b80 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Core_types/Wire/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Core_types/Wire/index.html @@ -1,3 +1,3 @@ -Wire (capnp-rpc.Capnp_rpc_proto.Message_types.ENDPOINT.Core_types.Wire)

Module Core_types.Wire

The core RPC logic can be used with different serialisation systems. The appropriate types should be provided here.

type request
type response
type 'a msg
module Path : sig ... end

A field in a message that refers to a capability.

module Request : +Wire (capnp-rpc.Capnp_rpc_proto.Message_types.ENDPOINT.Core_types.Wire)

Module Core_types.Wire

The core RPC logic can be used with different serialisation systems. The appropriate types should be provided here.

type request
type response
type 'a msg
module Path : sig ... end

A field in a message that refers to a capability.

module Request : S.WIRE_PAYLOAD with type t = request msg and type path := Path.t
module Response : sig ... end
val ref_leak_detected : int -> (unit -> unit) -> unit

ref_leak_detected thread_id fn is called when a promise or capability is GC'd while its ref-count is non-zero, indicating that resources may have been leaked. fn () will log a warning about this and free the resources itself. The reason for going via ref_leak_detected rather than calling fn directly is because the OCaml GC may detect the problem at any point (e.g. while we're sending another message). The implementation should arrange for fn to be called at a safe point in thread thread_id (e.g. when returning to the thread's main loop). Unit-tests may wish to call fn immediately to show the error and then fail the test.

diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Core_types/class-ref_counted/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Core_types/class-ref_counted/index.html index 07957e27..fee62d48 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Core_types/class-ref_counted/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Core_types/class-ref_counted/index.html @@ -1,2 +1,2 @@ -ref_counted (capnp-rpc.Capnp_rpc_proto.Message_types.ENDPOINT.Core_types.ref_counted)

Class Core_types.ref_counted

A mix-in to help with writing reference-counted objects. It will call self#release when the ref-count reaches zero.

method private virtual release : unit
method virtual pp : Stdlib.Format.formatter -> unit
method private pp_refcount : Stdlib.Format.formatter -> unit

Write the current ref-count to the formatter (use with "%t").

method private check_refcount : unit

Raise an exception if the ref-count is less than one (i.e. check that the object hasn't already been freed).

method update_rc : int -> unit
method check_invariants : unit
method virtual blocker : base_ref option
method sealed_dispatch : 'a. 'a Capnp_rpc_proto__.S.brand -> 'a option
+ref_counted (capnp-rpc.Capnp_rpc_proto.Message_types.ENDPOINT.Core_types.ref_counted)

Class Core_types.ref_counted

A mix-in to help with writing reference-counted objects. It will call self#release when the ref-count reaches zero.

method private virtual release : unit
method virtual pp : Stdlib.Format.formatter -> unit
method private pp_refcount : Stdlib.Format.formatter -> unit

Write the current ref-count to the formatter (use with "%t").

method private check_refcount : unit

Raise an exception if the ref-count is less than one (i.e. check that the object hasn't already been freed).

method update_rc : int -> unit
method check_invariants : unit
method virtual blocker : base_ref option
method sealed_dispatch : 'a. 'a Capnp_rpc_proto__.S.brand -> 'a option
diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Core_types/class-service/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Core_types/class-service/index.html index dce0fcfa..8667c8e6 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Core_types/class-service/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Core_types/class-service/index.html @@ -1,2 +1,2 @@ -service (capnp-rpc.Capnp_rpc_proto.Message_types.ENDPOINT.Core_types.service)

Class Core_types.service

A convenience base class for creating local services. The capability is always resolved, and the default release method does nothing.

inherit base_ref
inherit ref_counted
method virtual call : struct_resolver -> Wire.Request.t -> unit
method shortest : cap
method private release : unit
method when_more_resolved : (cap -> unit) -> unit
method when_released : (unit -> unit) -> unit
method problem : Capnp_rpc_proto__.Exception.t option
+service (capnp-rpc.Capnp_rpc_proto.Message_types.ENDPOINT.Core_types.service)

Class Core_types.service

A convenience base class for creating local services. The capability is always resolved, and the default release method does nothing.

inherit base_ref
inherit ref_counted
method virtual call : struct_resolver -> Wire.Request.t -> unit
method shortest : cap
method private release : unit
method when_more_resolved : (cap -> unit) -> unit
method when_released : (unit -> unit) -> unit
method problem : Capnp_rpc_proto__.Exception.t option
diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Core_types/class-type-base_ref/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Core_types/class-type-base_ref/index.html index 0047c6d6..396fe938 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Core_types/class-type-base_ref/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Core_types/class-type-base_ref/index.html @@ -1,2 +1,2 @@ -base_ref (capnp-rpc.Capnp_rpc_proto.Message_types.ENDPOINT.Core_types.base_ref)

Class type Core_types.base_ref

Common methods for struct_ref and cap.

method pp : Stdlib.Format.formatter -> unit
method update_rc : int -> unit

c#update_rc d adds d to c's (local) reference count. When it reaches zero, c must not be used again. A message may be sent releasing any remote resources.

method blocker : base_ref option

c#blocker is the unresolved cap or struct_ref promise that must resolve for c to resolve. This is used to help detect cycles.

method check_invariants : unit

This is for debugging. Checks its own invariants and those of other base_refs it holds. Raises Invariant_broken if there is a problem.

method sealed_dispatch : 'a. 'a Capnp_rpc_proto__.S.brand -> 'a option

c#sealed_dispatch brand extracts some private data of the given type.

+base_ref (capnp-rpc.Capnp_rpc_proto.Message_types.ENDPOINT.Core_types.base_ref)

Class type Core_types.base_ref

Common methods for struct_ref and cap.

method pp : Stdlib.Format.formatter -> unit
method update_rc : int -> unit

c#update_rc d adds d to c's (local) reference count. When it reaches zero, c must not be used again. A message may be sent releasing any remote resources.

method blocker : base_ref option

c#blocker is the unresolved cap or struct_ref promise that must resolve for c to resolve. This is used to help detect cycles.

method check_invariants : unit

This is for debugging. Checks its own invariants and those of other base_refs it holds. Raises Invariant_broken if there is a problem.

method sealed_dispatch : 'a. 'a Capnp_rpc_proto__.S.brand -> 'a option

c#sealed_dispatch brand extracts some private data of the given type.

diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Core_types/class-type-cap/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Core_types/class-type-cap/index.html index c356d265..a30f0597 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Core_types/class-type-cap/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Core_types/class-type-cap/index.html @@ -1,2 +1,2 @@ -cap (capnp-rpc.Capnp_rpc_proto.Message_types.ENDPOINT.Core_types.cap)

Class type Core_types.cap

A 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.

inherit base_ref
method call : struct_resolver -> Wire.Request.t -> unit

c#call results msg invokes a method on c's target and eventually resolves results with the answer.

method shortest : cap

c#shortest is the shortest known path to cap. i.e. if c is forwarding to another cap, we return that, recursively.

method when_more_resolved : (cap -> unit) -> unit

c#when_more_resolved fn calls fn x when this cap becomes more resolved. fn x gets a reference to x and needs to dec_ref it. Note that the new capability can be another promise. If c is already resolved to its final value, this does nothing. If c is a far-ref, fn x will be called when it breaks. If c is forwarding to another cap, it will forward this call. If c gets released before calling fn, it will never call it.

method when_released : (unit -> unit) -> unit

c#when_released fn will call fn () when c's ref-count drops to zero. This is used for caches, to remove entries when they become invalid. For promises, fn will be transferred to the resolution if resolved. For broken caps, this method does nothing (exceptions are never released).

method problem : Capnp_rpc_proto__.Exception.t option

c#problem is the exception for a broken reference, or None if it is not known to be broken.

+cap (capnp-rpc.Capnp_rpc_proto.Message_types.ENDPOINT.Core_types.cap)

Class type Core_types.cap

A 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.

inherit base_ref
method call : struct_resolver -> Wire.Request.t -> unit

c#call results msg invokes a method on c's target and eventually resolves results with the answer.

method shortest : cap

c#shortest is the shortest known path to cap. i.e. if c is forwarding to another cap, we return that, recursively.

method when_more_resolved : (cap -> unit) -> unit

c#when_more_resolved fn calls fn x when this cap becomes more resolved. fn x gets a reference to x and needs to dec_ref it. Note that the new capability can be another promise. If c is already resolved to its final value, this does nothing. If c is a far-ref, fn x will be called when it breaks. If c is forwarding to another cap, it will forward this call. If c gets released before calling fn, it will never call it.

method when_released : (unit -> unit) -> unit

c#when_released fn will call fn () when c's ref-count drops to zero. This is used for caches, to remove entries when they become invalid. For promises, fn will be transferred to the resolution if resolved. For broken caps, this method does nothing (exceptions are never released).

method problem : Capnp_rpc_proto__.Exception.t option

c#problem is the exception for a broken reference, or None if it is not known to be broken.

diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Core_types/class-type-struct_ref/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Core_types/class-type-struct_ref/index.html index 2c38ba23..e959da5f 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Core_types/class-type-struct_ref/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Core_types/class-type-struct_ref/index.html @@ -1,2 +1,2 @@ -struct_ref (capnp-rpc.Capnp_rpc_proto.Message_types.ENDPOINT.Core_types.struct_ref)

Class type Core_types.struct_ref

The 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.

inherit base_ref
method when_resolved : (Wire.Response.t or_error -> unit) -> unit

r#when_resolved fn queues up fn to be called on the result, when it arrives. If the result has already arrived, fn is called immediately.

method response : Wire.Response.t or_error option

r#response is Some payload if the response has arrived, or None if we're still waiting.

method cap : Wire.Path.t -> cap

r#cap path is the capability found at path in the response. If the response has arrived, this will extract the capability from it. If not, it may create a capability that will pipeline through the promised answer until the result arrives (at which point it will use the new, more direct route). The caller should call cap#dec_ref when done.

+struct_ref (capnp-rpc.Capnp_rpc_proto.Message_types.ENDPOINT.Core_types.struct_ref)

Class type Core_types.struct_ref

The 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.

inherit base_ref
method when_resolved : (Wire.Response.t or_error -> unit) -> unit

r#when_resolved fn queues up fn to be called on the result, when it arrives. If the result has already arrived, fn is called immediately.

method response : Wire.Response.t or_error option

r#response is Some payload if the response has arrived, or None if we're still waiting.

method cap : Wire.Path.t -> cap

r#cap path is the capability found at path in the response. If the response has arrived, this will extract the capability from it. If not, it may create a capability that will pipeline through the promised answer until the result arrives (at which point it will use the new, more direct route). The caller should call cap#dec_ref when done.

diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Core_types/class-type-struct_resolver/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Core_types/class-type-struct_resolver/index.html index 733999da..d4968912 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Core_types/class-type-struct_resolver/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Core_types/class-type-struct_resolver/index.html @@ -1,2 +1,2 @@ -struct_resolver (capnp-rpc.Capnp_rpc_proto.Message_types.ENDPOINT.Core_types.struct_resolver)

Class type Core_types.struct_resolver

A struct_resolver can be used to resolve some promise.

method pp : Stdlib.Format.formatter -> unit
method resolve : struct_ref -> unit

r#resolve x causes r's promise to behave as x in future. The promise takes ownership of x (is responsible for calling dec_rec on it).

method sealed_dispatch : 'a. 'a Capnp_rpc_proto__.S.brand -> 'a option

r#sealed_dispatch brand extracts some private data of the given type.

method set_blocker : base_ref -> (unit, [> `Cycle ]) Stdlib.result

r#set_blocker b means that resolve won't be called until b is resolved. r's promise should report this as its blocker. This is needed to detect cycles. When the blocker is resolved, call this again with None to clear it (the promise will then report itself as the blocker again, until resolved).

method clear_blocker : unit

r#clear_blocker removes the blocker set by set_blocker. r is then blocked by itself, if unresolved.

+struct_resolver (capnp-rpc.Capnp_rpc_proto.Message_types.ENDPOINT.Core_types.struct_resolver)

Class type Core_types.struct_resolver

A struct_resolver can be used to resolve some promise.

method pp : Stdlib.Format.formatter -> unit
method resolve : struct_ref -> unit

r#resolve x causes r's promise to behave as x in future. The promise takes ownership of x (is responsible for calling dec_rec on it).

method sealed_dispatch : 'a. 'a Capnp_rpc_proto__.S.brand -> 'a option

r#sealed_dispatch brand extracts some private data of the given type.

method set_blocker : base_ref -> (unit, [> `Cycle ]) Stdlib.result

r#set_blocker b means that resolve won't be called until b is resolved. r's promise should report this as its blocker. This is needed to detect cycles. When the blocker is resolved, call this again with None to clear it (the promise will then report itself as the blocker again, until resolved).

method clear_blocker : unit

r#clear_blocker removes the blocker set by set_blocker. r is then blocked by itself, if unresolved.

diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Core_types/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Core_types/index.html index 79435bb1..eca6c246 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Core_types/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Core_types/index.html @@ -1,5 +1,5 @@ -Core_types (capnp-rpc.Capnp_rpc_proto.Message_types.ENDPOINT.Core_types)

Module ENDPOINT.Core_types

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.

module Wire : S.WIRE

The core RPC logic can be used with different serialisation systems. The appropriate types should be provided here.

type 'a or_error = ('a, Error.t) Stdlib.result
class type base_ref = object ... end

Common methods for struct_ref and cap.

val pp : base_ref Fmt.t
val inc_ref : base_ref -> unit

inc_ref x increases x's ref-count by one.

val dec_ref : base_ref -> unit

dec_ref x decreases x's ref-count by one.

class type struct_ref = object ... end

The 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 ... end

A 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 ... end

A struct_resolver can be used to resolve some promise.

module Attachments : sig ... end
module Request_payload : +Core_types (capnp-rpc.Capnp_rpc_proto.Message_types.ENDPOINT.Core_types)

Module ENDPOINT.Core_types

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.

module Wire : S.WIRE

The core RPC logic can be used with different serialisation systems. The appropriate types should be provided here.

type 'a or_error = ('a, Error.t) Stdlib.result
class type base_ref = object ... end

Common methods for struct_ref and cap.

val pp : base_ref Fmt.t
val inc_ref : base_ref -> unit

inc_ref x increases x's ref-count by one.

val dec_ref : base_ref -> unit

dec_ref x decreases x's ref-count by one.

class type struct_ref = object ... end

The 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 ... end

A 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 ... end

A struct_resolver can be used to resolve some promise.

module Attachments : sig ... end
module Request_payload : S.PAYLOAD with type t = Wire.Request.t and type cap := cap diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/In/AnswerId/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/In/AnswerId/index.html index 9fab0276..e6acab54 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/In/AnswerId/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/In/AnswerId/index.html @@ -1,2 +1,2 @@ -AnswerId (capnp-rpc.Capnp_rpc_proto.Message_types.ENDPOINT.In.AnswerId)

Module In.AnswerId

val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
+AnswerId (capnp-rpc.Capnp_rpc_proto.Message_types.ENDPOINT.In.AnswerId)

Module In.AnswerId

val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/In/ExportId/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/In/ExportId/index.html index 682c2962..731b4de5 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/In/ExportId/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/In/ExportId/index.html @@ -1,2 +1,2 @@ -ExportId (capnp-rpc.Capnp_rpc_proto.Message_types.ENDPOINT.In.ExportId)

Module In.ExportId

val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
+ExportId (capnp-rpc.Capnp_rpc_proto.Message_types.ENDPOINT.In.ExportId)

Module In.ExportId

val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/In/ImportId/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/In/ImportId/index.html index ea63e30f..80c9e99d 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/In/ImportId/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/In/ImportId/index.html @@ -1,2 +1,2 @@ -ImportId (capnp-rpc.Capnp_rpc_proto.Message_types.ENDPOINT.In.ImportId)

Module In.ImportId

val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
+ImportId (capnp-rpc.Capnp_rpc_proto.Message_types.ENDPOINT.In.ImportId)

Module In.ImportId

val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/In/QuestionId/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/In/QuestionId/index.html index c0f3d5fa..ba891a25 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/In/QuestionId/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/In/QuestionId/index.html @@ -1,2 +1,2 @@ -QuestionId (capnp-rpc.Capnp_rpc_proto.Message_types.ENDPOINT.In.QuestionId)

Module In.QuestionId

val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
+QuestionId (capnp-rpc.Capnp_rpc_proto.Message_types.ENDPOINT.In.QuestionId)

Module In.QuestionId

val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/In/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/In/index.html index fa4644d5..7ab2d88a 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/In/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/In/index.html @@ -1,5 +1,5 @@ -In (capnp-rpc.Capnp_rpc_proto.Message_types.ENDPOINT.In)

Module ENDPOINT.In

The type of messages received by this endpoint.

module QuestionId : sig ... end
module AnswerId : sig ... end
module ImportId : sig ... end
module ExportId : sig ... end
type message_target = [
  1. | `ReceiverAnswer of QuestionId.t * Core_types.Wire.Path.t
  2. | `ReceiverHosted of ImportId.t
]
type desc = [
  1. | `None
  2. | `ReceiverAnswer of QuestionId.t * Core_types.Wire.Path.t
  3. | `ReceiverHosted of ImportId.t
  4. | `SenderHosted of ExportId.t
  5. | `SenderPromise of ExportId.t
  6. | `ThirdPartyHosted of third_party_desc
]
val pp_desc : +In (capnp-rpc.Capnp_rpc_proto.Message_types.ENDPOINT.In)

Module ENDPOINT.In

The type of messages received by this endpoint.

module QuestionId : sig ... end
module AnswerId : sig ... end
module ImportId : sig ... end
module ExportId : sig ... end
type message_target = [
  1. | `ReceiverAnswer of QuestionId.t * Core_types.Wire.Path.t
  2. | `ReceiverHosted of ImportId.t
]
type desc = [
  1. | `None
  2. | `ReceiverAnswer of QuestionId.t * Core_types.Wire.Path.t
  3. | `ReceiverHosted of ImportId.t
  4. | `SenderHosted of ExportId.t
  5. | `SenderPromise of ExportId.t
  6. | `ThirdPartyHosted of third_party_desc
]
val pp_desc : Stdlib.Format.formatter -> [< `Local of < pp : Stdlib.Format.formatter -> unit.. > | `None diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Network_types/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Network_types/index.html index a4286a96..eb79427f 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Network_types/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Network_types/index.html @@ -1,2 +1,2 @@ -Network_types (capnp-rpc.Capnp_rpc_proto.Message_types.ENDPOINT.Network_types)

Module ENDPOINT.Network_types

type provision_id
type recipient_id
type third_party_cap_id
type join_key_part
+Network_types (capnp-rpc.Capnp_rpc_proto.Message_types.ENDPOINT.Network_types)

Module ENDPOINT.Network_types

type provision_id
type recipient_id
type third_party_cap_id
type join_key_part
diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Out/AnswerId/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Out/AnswerId/index.html index 728da0b9..b2d98603 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Out/AnswerId/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Out/AnswerId/index.html @@ -1,2 +1,2 @@ -AnswerId (capnp-rpc.Capnp_rpc_proto.Message_types.ENDPOINT.Out.AnswerId)

Module Out.AnswerId

val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
+AnswerId (capnp-rpc.Capnp_rpc_proto.Message_types.ENDPOINT.Out.AnswerId)

Module Out.AnswerId

val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Out/ExportId/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Out/ExportId/index.html index 49144f05..02ca00d1 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Out/ExportId/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Out/ExportId/index.html @@ -1,2 +1,2 @@ -ExportId (capnp-rpc.Capnp_rpc_proto.Message_types.ENDPOINT.Out.ExportId)

Module Out.ExportId

val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
+ExportId (capnp-rpc.Capnp_rpc_proto.Message_types.ENDPOINT.Out.ExportId)

Module Out.ExportId

val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Out/ImportId/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Out/ImportId/index.html index 4884f063..e4a71d34 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Out/ImportId/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Out/ImportId/index.html @@ -1,2 +1,2 @@ -ImportId (capnp-rpc.Capnp_rpc_proto.Message_types.ENDPOINT.Out.ImportId)

Module Out.ImportId

val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
+ImportId (capnp-rpc.Capnp_rpc_proto.Message_types.ENDPOINT.Out.ImportId)

Module Out.ImportId

val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Out/QuestionId/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Out/QuestionId/index.html index 36f03c14..1d7e52a4 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Out/QuestionId/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Out/QuestionId/index.html @@ -1,2 +1,2 @@ -QuestionId (capnp-rpc.Capnp_rpc_proto.Message_types.ENDPOINT.Out.QuestionId)

Module Out.QuestionId

val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
+QuestionId (capnp-rpc.Capnp_rpc_proto.Message_types.ENDPOINT.Out.QuestionId)

Module Out.QuestionId

val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Out/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Out/index.html index 7cfd0f30..d3904034 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Out/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Out/index.html @@ -1,5 +1,5 @@ -Out (capnp-rpc.Capnp_rpc_proto.Message_types.ENDPOINT.Out)

Module ENDPOINT.Out

The type of messages sent by this endpoint.

module QuestionId : sig ... end
module AnswerId : sig ... end
module ImportId : sig ... end
module ExportId : sig ... end
type message_target = [
  1. | `ReceiverAnswer of QuestionId.t * Core_types.Wire.Path.t
  2. | `ReceiverHosted of ImportId.t
]
type desc = [
  1. | `None
  2. | `ReceiverAnswer of QuestionId.t * Core_types.Wire.Path.t
  3. | `ReceiverHosted of ImportId.t
  4. | `SenderHosted of ExportId.t
  5. | `SenderPromise of ExportId.t
  6. | `ThirdPartyHosted of third_party_desc
]
val pp_desc : +Out (capnp-rpc.Capnp_rpc_proto.Message_types.ENDPOINT.Out)

Module ENDPOINT.Out

The type of messages sent by this endpoint.

module QuestionId : sig ... end
module AnswerId : sig ... end
module ImportId : sig ... end
module ExportId : sig ... end
type message_target = [
  1. | `ReceiverAnswer of QuestionId.t * Core_types.Wire.Path.t
  2. | `ReceiverHosted of ImportId.t
]
type desc = [
  1. | `None
  2. | `ReceiverAnswer of QuestionId.t * Core_types.Wire.Path.t
  3. | `ReceiverHosted of ImportId.t
  4. | `SenderHosted of ExportId.t
  5. | `SenderPromise of ExportId.t
  6. | `ThirdPartyHosted of third_party_desc
]
val pp_desc : Stdlib.Format.formatter -> [< `Local of < pp : Stdlib.Format.formatter -> unit.. > | `None diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Table/AnswerId/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Table/AnswerId/index.html index a0f3b0d7..1fc050c0 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Table/AnswerId/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Table/AnswerId/index.html @@ -1,2 +1,2 @@ -AnswerId (capnp-rpc.Capnp_rpc_proto.Message_types.ENDPOINT.Table.AnswerId)

Module Table.AnswerId

type t = private Stdint.Uint32.t
val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
+AnswerId (capnp-rpc.Capnp_rpc_proto.Message_types.ENDPOINT.Table.AnswerId)

Module Table.AnswerId

type t = private Stdint.Uint32.t
val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Table/ExportId/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Table/ExportId/index.html index 8869a996..ec8ded27 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Table/ExportId/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Table/ExportId/index.html @@ -1,2 +1,2 @@ -ExportId (capnp-rpc.Capnp_rpc_proto.Message_types.ENDPOINT.Table.ExportId)

Module Table.ExportId

type t = private Stdint.Uint32.t
val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
+ExportId (capnp-rpc.Capnp_rpc_proto.Message_types.ENDPOINT.Table.ExportId)

Module Table.ExportId

type t = private Stdint.Uint32.t
val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Table/ImportId/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Table/ImportId/index.html index d2887716..395e7129 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Table/ImportId/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Table/ImportId/index.html @@ -1,2 +1,2 @@ -ImportId (capnp-rpc.Capnp_rpc_proto.Message_types.ENDPOINT.Table.ImportId)

Module Table.ImportId

type t = private Stdint.Uint32.t
val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
+ImportId (capnp-rpc.Capnp_rpc_proto.Message_types.ENDPOINT.Table.ImportId)

Module Table.ImportId

type t = private Stdint.Uint32.t
val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Table/QuestionId/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Table/QuestionId/index.html index 4975e04b..8410ffec 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Table/QuestionId/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Table/QuestionId/index.html @@ -1,2 +1,2 @@ -QuestionId (capnp-rpc.Capnp_rpc_proto.Message_types.ENDPOINT.Table.QuestionId)

Module Table.QuestionId

type t = private Stdint.Uint32.t
val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
+QuestionId (capnp-rpc.Capnp_rpc_proto.Message_types.ENDPOINT.Table.QuestionId)

Module Table.QuestionId

type t = private Stdint.Uint32.t
val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Table/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Table/index.html index 98cf90d2..175cab9c 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Table/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/Table/index.html @@ -1,2 +1,2 @@ -Table (capnp-rpc.Capnp_rpc_proto.Message_types.ENDPOINT.Table)

Module ENDPOINT.Table

For the unit tests it is convenient to pass in the types of table indexes. This allows the tests to make both ends of a connection, with the types matched up.

module QuestionId : Id.S
module AnswerId : Id.S
module ImportId : Id.S
module ExportId : Id.S
+Table (capnp-rpc.Capnp_rpc_proto.Message_types.ENDPOINT.Table)

Module ENDPOINT.Table

For the unit tests it is convenient to pass in the types of table indexes. This allows the tests to make both ends of a connection, with the types matched up.

module QuestionId : Id.S
module AnswerId : Id.S
module ImportId : Id.S
module ExportId : Id.S
diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/index.html index 846a8835..5ad15da0 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-ENDPOINT/index.html @@ -1,2 +1,2 @@ -ENDPOINT (capnp-rpc.Capnp_rpc_proto.Message_types.ENDPOINT)

Module type Message_types.ENDPOINT

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.

For the unit tests it is convenient to pass in the types of table indexes. This allows the tests to make both ends of a connection, with the types matched up.

module Out : sig ... end

The type of messages sent by this endpoint.

module In : sig ... end

The type of messages received by this endpoint.

+ENDPOINT (capnp-rpc.Capnp_rpc_proto.Message_types.ENDPOINT)

Module type Message_types.ENDPOINT

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.

For the unit tests it is convenient to pass in the types of table indexes. This allows the tests to make both ends of a connection, with the types matched up.

module Out : sig ... end

The type of messages sent by this endpoint.

module In : sig ... end

The type of messages received by this endpoint.

diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-TABLE_TYPES/AnswerId/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-TABLE_TYPES/AnswerId/index.html index fcc4a3ff..1941558b 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-TABLE_TYPES/AnswerId/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-TABLE_TYPES/AnswerId/index.html @@ -1,2 +1,2 @@ -AnswerId (capnp-rpc.Capnp_rpc_proto.Message_types.TABLE_TYPES.AnswerId)

Module TABLE_TYPES.AnswerId

type t = private Stdint.Uint32.t
val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
+AnswerId (capnp-rpc.Capnp_rpc_proto.Message_types.TABLE_TYPES.AnswerId)

Module TABLE_TYPES.AnswerId

type t = private Stdint.Uint32.t
val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-TABLE_TYPES/ExportId/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-TABLE_TYPES/ExportId/index.html index d6560ee6..5b2815c0 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-TABLE_TYPES/ExportId/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-TABLE_TYPES/ExportId/index.html @@ -1,2 +1,2 @@ -ExportId (capnp-rpc.Capnp_rpc_proto.Message_types.TABLE_TYPES.ExportId)

Module TABLE_TYPES.ExportId

type t = private Stdint.Uint32.t
val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
+ExportId (capnp-rpc.Capnp_rpc_proto.Message_types.TABLE_TYPES.ExportId)

Module TABLE_TYPES.ExportId

type t = private Stdint.Uint32.t
val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-TABLE_TYPES/ImportId/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-TABLE_TYPES/ImportId/index.html index c320a178..fad8fb36 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-TABLE_TYPES/ImportId/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-TABLE_TYPES/ImportId/index.html @@ -1,2 +1,2 @@ -ImportId (capnp-rpc.Capnp_rpc_proto.Message_types.TABLE_TYPES.ImportId)

Module TABLE_TYPES.ImportId

type t = private Stdint.Uint32.t
val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
+ImportId (capnp-rpc.Capnp_rpc_proto.Message_types.TABLE_TYPES.ImportId)

Module TABLE_TYPES.ImportId

type t = private Stdint.Uint32.t
val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-TABLE_TYPES/QuestionId/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-TABLE_TYPES/QuestionId/index.html index 50844af5..3f09155b 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-TABLE_TYPES/QuestionId/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-TABLE_TYPES/QuestionId/index.html @@ -1,2 +1,2 @@ -QuestionId (capnp-rpc.Capnp_rpc_proto.Message_types.TABLE_TYPES.QuestionId)

Module TABLE_TYPES.QuestionId

type t = private Stdint.Uint32.t
val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
+QuestionId (capnp-rpc.Capnp_rpc_proto.Message_types.TABLE_TYPES.QuestionId)

Module TABLE_TYPES.QuestionId

type t = private Stdint.Uint32.t
val zero : t
val succ : t -> t
val uint32 : t -> Stdint.Uint32.t
val of_uint32 : Stdint.Uint32.t -> t
val pp : t Fmt.t
diff --git a/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-TABLE_TYPES/index.html b/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-TABLE_TYPES/index.html index e7c08eff..fdadf3ed 100644 --- a/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-TABLE_TYPES/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Message_types/module-type-TABLE_TYPES/index.html @@ -1,2 +1,2 @@ -TABLE_TYPES (capnp-rpc.Capnp_rpc_proto.Message_types.TABLE_TYPES)

Module type Message_types.TABLE_TYPES

For the unit tests it is convenient to pass in the types of table indexes. This allows the tests to make both ends of a connection, with the types matched up.

module QuestionId : Id.S
module AnswerId : Id.S
module ImportId : Id.S
module ExportId : Id.S
+TABLE_TYPES (capnp-rpc.Capnp_rpc_proto.Message_types.TABLE_TYPES)

Module type Message_types.TABLE_TYPES

For the unit tests it is convenient to pass in the types of table indexes. This allows the tests to make both ends of a connection, with the types matched up.

module QuestionId : Id.S
module AnswerId : Id.S
module ImportId : Id.S
module ExportId : Id.S
diff --git a/capnp-rpc/Capnp_rpc_proto/RC/index.html b/capnp-rpc/Capnp_rpc_proto/RC/index.html index 1312a8cd..25ca97e6 100644 --- a/capnp-rpc/Capnp_rpc_proto/RC/index.html +++ b/capnp-rpc/Capnp_rpc_proto/RC/index.html @@ -1,2 +1,2 @@ -RC (capnp-rpc.Capnp_rpc_proto.RC)

Module Capnp_rpc_proto.RC

A ref-count type that raises an exception on overflow.

type t

A number used as a reference count.

val zero : t
val one : t
val leaked : t

leaked is used to represent a ref-count that is invalid because we detected a GC leak.

val sum : pp:(Stdlib.Format.formatter -> unit) -> t -> int -> t

sum ~pp t d is t + d. Raises an exception (including pp) if this would overflow or become negative, or if t is zero or leaked.

val succ : pp:(Stdlib.Format.formatter -> unit) -> t -> t

succ ~pp t is add ~pp t 1.

val pred : pp:(Stdlib.Format.formatter -> unit) -> t -> t

pred ~pp t is add ~pp t (-1).

val is_zero : t -> bool

is_zero t is true if the ref-count is zero (the resource should be released). is_zero leaked = false, since whatever detected the leak should free it.

val pp : t Fmt.t
val check : pp:(Stdlib.Format.formatter -> unit) -> t -> unit

check ~pp t raises an exception (including pp) if t is zero or leaked. Useful in sanity checks.

val to_int : t -> int option

to_int t is the non-negative integer ref-count, or None if t = leaked.

+RC (capnp-rpc.Capnp_rpc_proto.RC)

Module Capnp_rpc_proto.RC

A ref-count type that raises an exception on overflow.

type t

A number used as a reference count.

val zero : t
val one : t
val leaked : t

leaked is used to represent a ref-count that is invalid because we detected a GC leak.

val sum : pp:(Stdlib.Format.formatter -> unit) -> t -> int -> t

sum ~pp t d is t + d. Raises an exception (including pp) if this would overflow or become negative, or if t is zero or leaked.

val succ : pp:(Stdlib.Format.formatter -> unit) -> t -> t

succ ~pp t is add ~pp t 1.

val pred : pp:(Stdlib.Format.formatter -> unit) -> t -> t

pred ~pp t is add ~pp t (-1).

val is_zero : t -> bool

is_zero t is true if the ref-count is zero (the resource should be released). is_zero leaked = false, since whatever detected the leak should free it.

val pp : t Fmt.t
val check : pp:(Stdlib.Format.formatter -> unit) -> t -> unit

check ~pp t raises an exception (including pp) if t is zero or leaked. Useful in sanity checks.

val to_int : t -> int option

to_int t is the non-negative integer ref-count, or None if t = leaked.

diff --git a/capnp-rpc/Capnp_rpc_proto/RO_array/index.html b/capnp-rpc/Capnp_rpc_proto/RO_array/index.html index 4bf3e85c..82889613 100644 --- a/capnp-rpc/Capnp_rpc_proto/RO_array/index.html +++ b/capnp-rpc/Capnp_rpc_proto/RO_array/index.html @@ -1,2 +1,2 @@ -RO_array (capnp-rpc.Capnp_rpc_proto.RO_array)

Module Capnp_rpc_proto.RO_array

A read-only array.

type 'a t
val of_list : 'a list -> 'a t
val init : int -> (int -> 'a) -> 'a t
val get_exn : 'a t -> int -> 'a
val get : oob:'a -> 'a t -> int -> 'a
val length : 'a t -> int
val map : ('a -> 'b) -> 'a t -> 'b t
val mapi : (int -> 'a -> 'b) -> 'a t -> 'b t
val iter : ('a -> unit) -> 'a t -> unit
val iteri : (int -> 'a -> unit) -> 'a t -> unit
val fold_left : ('a -> 'b -> 'a) -> 'a -> 'b t -> 'a
val find : ('a -> bool) -> 'a t -> 'a option
val empty : 'a t
val pp : 'a Fmt.t -> 'a t Fmt.t
val equal : ('a -> 'a -> bool) -> 'a t -> 'a t -> bool
val release : 'a t -> 'a -> unit

release t null replaces every element in the array with null. This is useful to mark the array as finished.

+RO_array (capnp-rpc.Capnp_rpc_proto.RO_array)

Module Capnp_rpc_proto.RO_array

A read-only array.

type 'a t
val of_list : 'a list -> 'a t
val init : int -> (int -> 'a) -> 'a t
val get_exn : 'a t -> int -> 'a
val get : oob:'a -> 'a t -> int -> 'a
val length : 'a t -> int
val map : ('a -> 'b) -> 'a t -> 'b t
val mapi : (int -> 'a -> 'b) -> 'a t -> 'b t
val iter : ('a -> unit) -> 'a t -> unit
val iteri : (int -> 'a -> unit) -> 'a t -> unit
val fold_left : ('a -> 'b -> 'a) -> 'a -> 'b t -> 'a
val find : ('a -> bool) -> 'a t -> 'a option
val empty : 'a t
val pp : 'a Fmt.t -> 'a t Fmt.t
val equal : ('a -> 'a -> bool) -> 'a t -> 'a t -> bool
val release : 'a t -> 'a -> unit

release t null replaces every element in the array with null. This is useful to mark the array as finished.

diff --git a/capnp-rpc/Capnp_rpc_proto/S/index.html b/capnp-rpc/Capnp_rpc_proto/S/index.html index b914246e..5835024a 100644 --- a/capnp-rpc/Capnp_rpc_proto/S/index.html +++ b/capnp-rpc/Capnp_rpc_proto/S/index.html @@ -1,2 +1,2 @@ -S (capnp-rpc.Capnp_rpc_proto.S)

Module Capnp_rpc_proto.S

The core types and module signatures.

type 'a brand = ..

A way for objects to provide an optional private API to certain other modules. For example, CapTP proxies appear as plain services, but use this to reveal their target details to the CapTP layer so that it can shorten the path when sending such capabilties over the network.

type attachments = ..

The capabilities attached to a message. This is only defined as an open type to avoid a nasty recursive type definition.

type attachments +=
  1. | No_attachments
module type WIRE_PAYLOAD = sig ... end
module type WIRE = sig ... end

The core RPC logic can be used with different serialisation systems. The appropriate types should be provided here.

module type PAYLOAD = sig ... end

Wraps WIRE_PAYLOAD to deal with caps rather than attachments.

module type CORE_TYPES = sig ... end

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.

module type NETWORK_TYPES = sig ... end
+S (capnp-rpc.Capnp_rpc_proto.S)

Module Capnp_rpc_proto.S

The core types and module signatures.

type 'a brand = ..

A way for objects to provide an optional private API to certain other modules. For example, CapTP proxies appear as plain services, but use this to reveal their target details to the CapTP layer so that it can shorten the path when sending such capabilties over the network.

type attachments = ..

The capabilities attached to a message. This is only defined as an open type to avoid a nasty recursive type definition.

type attachments +=
  1. | No_attachments
module type WIRE_PAYLOAD = sig ... end
module type WIRE = sig ... end

The core RPC logic can be used with different serialisation systems. The appropriate types should be provided here.

module type PAYLOAD = sig ... end

Wraps WIRE_PAYLOAD to deal with caps rather than attachments.

module type CORE_TYPES = sig ... end

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.

module type NETWORK_TYPES = sig ... end
diff --git a/capnp-rpc/Capnp_rpc_proto/S/module-type-CORE_TYPES/Attachments/index.html b/capnp-rpc/Capnp_rpc_proto/S/module-type-CORE_TYPES/Attachments/index.html index 15f03eaf..901f2e94 100644 --- a/capnp-rpc/Capnp_rpc_proto/S/module-type-CORE_TYPES/Attachments/index.html +++ b/capnp-rpc/Capnp_rpc_proto/S/module-type-CORE_TYPES/Attachments/index.html @@ -1,2 +1,2 @@ -Attachments (capnp-rpc.Capnp_rpc_proto.S.CORE_TYPES.Attachments)

Module CORE_TYPES.Attachments

val builder : unit -> attachments

builder () is a fresh writable attachments array.

val cap : int -> attachments -> cap

cap i t is the capability at index i in t. The reference count is increased by one.

val clear_cap : attachments -> int -> unit

Replace cap at index i with null and dec_ref it.

val add_cap : attachments -> cap -> int

add_cap t cap stores cap in t. t must have been created by builder. Increases the ref-count on cap by one.

val release_caps : attachments -> unit

release_caps a decreases the ref-count of every capability in a.

+Attachments (capnp-rpc.Capnp_rpc_proto.S.CORE_TYPES.Attachments)

Module CORE_TYPES.Attachments

val builder : unit -> attachments

builder () is a fresh writable attachments array.

val cap : int -> attachments -> cap

cap i t is the capability at index i in t. The reference count is increased by one.

val clear_cap : attachments -> int -> unit

Replace cap at index i with null and dec_ref it.

val add_cap : attachments -> cap -> int

add_cap t cap stores cap in t. t must have been created by builder. Increases the ref-count on cap by one.

val release_caps : attachments -> unit

release_caps a decreases the ref-count of every capability in a.

diff --git a/capnp-rpc/Capnp_rpc_proto/S/module-type-CORE_TYPES/Request_payload/index.html b/capnp-rpc/Capnp_rpc_proto/S/module-type-CORE_TYPES/Request_payload/index.html index 9c80e467..f6be3845 100644 --- a/capnp-rpc/Capnp_rpc_proto/S/module-type-CORE_TYPES/Request_payload/index.html +++ b/capnp-rpc/Capnp_rpc_proto/S/module-type-CORE_TYPES/Request_payload/index.html @@ -1,2 +1,2 @@ -Request_payload (capnp-rpc.Capnp_rpc_proto.S.CORE_TYPES.Request_payload)

Module CORE_TYPES.Request_payload

The payload of a request message.

Wraps WIRE_PAYLOAD to deal with caps rather than attachments.

val snapshot_caps : t -> cap RO_array.t
val field : t -> Wire.Path.t -> cap option

field t path looks up path in the message and returns the capability at that index. Returns None if the field wasn't set. Returns a broken capability if an index was given but does not exist (i.e. the message is corrupted). Increases the ref-count on the result.

val with_caps : cap RO_array.t -> t -> t

with_caps caps t is a copy of t with a new set of capabilities. This is useful to implement TakeFromOtherQuestion, where the message is the same but embargoes may be needed, and to break cycles.

val release : t -> unit

release t frees all the capabilities attached to this message. It is safe to call this multiple times; only the first call has any effect.

val pp : t Fmt.t
+Request_payload (capnp-rpc.Capnp_rpc_proto.S.CORE_TYPES.Request_payload)

Module CORE_TYPES.Request_payload

The payload of a request message.

Wraps WIRE_PAYLOAD to deal with caps rather than attachments.

val snapshot_caps : t -> cap RO_array.t
val field : t -> Wire.Path.t -> cap option

field t path looks up path in the message and returns the capability at that index. Returns None if the field wasn't set. Returns a broken capability if an index was given but does not exist (i.e. the message is corrupted). Increases the ref-count on the result.

val with_caps : cap RO_array.t -> t -> t

with_caps caps t is a copy of t with a new set of capabilities. This is useful to implement TakeFromOtherQuestion, where the message is the same but embargoes may be needed, and to break cycles.

val release : t -> unit

release t frees all the capabilities attached to this message. It is safe to call this multiple times; only the first call has any effect.

val pp : t Fmt.t
diff --git a/capnp-rpc/Capnp_rpc_proto/S/module-type-CORE_TYPES/Response_payload/index.html b/capnp-rpc/Capnp_rpc_proto/S/module-type-CORE_TYPES/Response_payload/index.html index 0b488c06..c4bb0427 100644 --- a/capnp-rpc/Capnp_rpc_proto/S/module-type-CORE_TYPES/Response_payload/index.html +++ b/capnp-rpc/Capnp_rpc_proto/S/module-type-CORE_TYPES/Response_payload/index.html @@ -1,2 +1,2 @@ -Response_payload (capnp-rpc.Capnp_rpc_proto.S.CORE_TYPES.Response_payload)

Module CORE_TYPES.Response_payload

The payload of a response message.

Wraps WIRE_PAYLOAD to deal with caps rather than attachments.

val snapshot_caps : t -> cap RO_array.t
val field : t -> Wire.Path.t -> cap option

field t path looks up path in the message and returns the capability at that index. Returns None if the field wasn't set. Returns a broken capability if an index was given but does not exist (i.e. the message is corrupted). Increases the ref-count on the result.

val with_caps : cap RO_array.t -> t -> t

with_caps caps t is a copy of t with a new set of capabilities. This is useful to implement TakeFromOtherQuestion, where the message is the same but embargoes may be needed, and to break cycles.

val release : t -> unit

release t frees all the capabilities attached to this message. It is safe to call this multiple times; only the first call has any effect.

val pp : t Fmt.t
+Response_payload (capnp-rpc.Capnp_rpc_proto.S.CORE_TYPES.Response_payload)

Module CORE_TYPES.Response_payload

The payload of a response message.

Wraps WIRE_PAYLOAD to deal with caps rather than attachments.

val snapshot_caps : t -> cap RO_array.t
val field : t -> Wire.Path.t -> cap option

field t path looks up path in the message and returns the capability at that index. Returns None if the field wasn't set. Returns a broken capability if an index was given but does not exist (i.e. the message is corrupted). Increases the ref-count on the result.

val with_caps : cap RO_array.t -> t -> t

with_caps caps t is a copy of t with a new set of capabilities. This is useful to implement TakeFromOtherQuestion, where the message is the same but embargoes may be needed, and to break cycles.

val release : t -> unit

release t frees all the capabilities attached to this message. It is safe to call this multiple times; only the first call has any effect.

val pp : t Fmt.t
diff --git a/capnp-rpc/Capnp_rpc_proto/S/module-type-CORE_TYPES/Wire/Path/index.html b/capnp-rpc/Capnp_rpc_proto/S/module-type-CORE_TYPES/Wire/Path/index.html index 79198001..0dff166d 100644 --- a/capnp-rpc/Capnp_rpc_proto/S/module-type-CORE_TYPES/Wire/Path/index.html +++ b/capnp-rpc/Capnp_rpc_proto/S/module-type-CORE_TYPES/Wire/Path/index.html @@ -1,2 +1,2 @@ -Path (capnp-rpc.Capnp_rpc_proto.S.CORE_TYPES.Wire.Path)

Module Wire.Path

A field in a message that refers to a capability.

include Stdlib.Map.OrderedType
type t
val compare : t -> t -> int
val root : t

The path for the bootstrap capability in the bootstrap message.

val pp : t Fmt.t
+Path (capnp-rpc.Capnp_rpc_proto.S.CORE_TYPES.Wire.Path)

Module Wire.Path

A field in a message that refers to a capability.

include Stdlib.Map.OrderedType
type t
val compare : t -> t -> int
val root : t

The path for the bootstrap capability in the bootstrap message.

val pp : t Fmt.t
diff --git a/capnp-rpc/Capnp_rpc_proto/S/module-type-CORE_TYPES/Wire/Request/index.html b/capnp-rpc/Capnp_rpc_proto/S/module-type-CORE_TYPES/Wire/Request/index.html index 12f09b03..a88f2049 100644 --- a/capnp-rpc/Capnp_rpc_proto/S/module-type-CORE_TYPES/Wire/Request/index.html +++ b/capnp-rpc/Capnp_rpc_proto/S/module-type-CORE_TYPES/Wire/Request/index.html @@ -1,2 +1,2 @@ -Request (capnp-rpc.Capnp_rpc_proto.S.CORE_TYPES.Wire.Request)

Module Wire.Request

type t = request msg

A message payload. This is typically a byte array of some kind, plus a way of attaching capabilities.

val pp : t Fmt.t
val cap_index : t -> Path.t -> int option

cap_index msg path is the capability index at path in the message (i.e the index of the capability in the attachments table).

val attachments : t -> attachments
val with_attachments : attachments -> t -> t
+Request (capnp-rpc.Capnp_rpc_proto.S.CORE_TYPES.Wire.Request)

Module Wire.Request

type t = request msg

A message payload. This is typically a byte array of some kind, plus a way of attaching capabilities.

val pp : t Fmt.t
val cap_index : t -> Path.t -> int option

cap_index msg path is the capability index at path in the message (i.e the index of the capability in the attachments table).

val attachments : t -> attachments
val with_attachments : attachments -> t -> t
diff --git a/capnp-rpc/Capnp_rpc_proto/S/module-type-CORE_TYPES/Wire/Response/index.html b/capnp-rpc/Capnp_rpc_proto/S/module-type-CORE_TYPES/Wire/Response/index.html index 42b4d94a..f2f8ab7a 100644 --- a/capnp-rpc/Capnp_rpc_proto/S/module-type-CORE_TYPES/Wire/Response/index.html +++ b/capnp-rpc/Capnp_rpc_proto/S/module-type-CORE_TYPES/Wire/Response/index.html @@ -1,2 +1,2 @@ -Response (capnp-rpc.Capnp_rpc_proto.S.CORE_TYPES.Wire.Response)

Module Wire.Response

include WIRE_PAYLOAD with type t = response msg and type path := Path.t
type t = response msg

A message payload. This is typically a byte array of some kind, plus a way of attaching capabilities.

val pp : t Fmt.t
val cap_index : t -> Path.t -> int option

cap_index msg path is the capability index at path in the message (i.e the index of the capability in the attachments table).

val attachments : t -> attachments
val with_attachments : attachments -> t -> t
val bootstrap : unit -> t

The (empty) content for the reply to the bootstrap message.

+Response (capnp-rpc.Capnp_rpc_proto.S.CORE_TYPES.Wire.Response)

Module Wire.Response

include WIRE_PAYLOAD with type t = response msg and type path := Path.t
type t = response msg

A message payload. This is typically a byte array of some kind, plus a way of attaching capabilities.

val pp : t Fmt.t
val cap_index : t -> Path.t -> int option

cap_index msg path is the capability index at path in the message (i.e the index of the capability in the attachments table).

val attachments : t -> attachments
val with_attachments : attachments -> t -> t
val bootstrap : unit -> t

The (empty) content for the reply to the bootstrap message.

diff --git a/capnp-rpc/Capnp_rpc_proto/S/module-type-CORE_TYPES/Wire/index.html b/capnp-rpc/Capnp_rpc_proto/S/module-type-CORE_TYPES/Wire/index.html index 54f46d07..ee2c9af2 100644 --- a/capnp-rpc/Capnp_rpc_proto/S/module-type-CORE_TYPES/Wire/index.html +++ b/capnp-rpc/Capnp_rpc_proto/S/module-type-CORE_TYPES/Wire/index.html @@ -1,2 +1,2 @@ -Wire (capnp-rpc.Capnp_rpc_proto.S.CORE_TYPES.Wire)

Module CORE_TYPES.Wire

The core RPC logic can be used with different serialisation systems. The appropriate types should be provided here.

type request
type response
type 'a msg
module Path : sig ... end

A field in a message that refers to a capability.

module Request : WIRE_PAYLOAD with type t = request msg and type path := Path.t
module Response : sig ... end
val ref_leak_detected : int -> (unit -> unit) -> unit

ref_leak_detected thread_id fn is called when a promise or capability is GC'd while its ref-count is non-zero, indicating that resources may have been leaked. fn () will log a warning about this and free the resources itself. The reason for going via ref_leak_detected rather than calling fn directly is because the OCaml GC may detect the problem at any point (e.g. while we're sending another message). The implementation should arrange for fn to be called at a safe point in thread thread_id (e.g. when returning to the thread's main loop). Unit-tests may wish to call fn immediately to show the error and then fail the test.

+Wire (capnp-rpc.Capnp_rpc_proto.S.CORE_TYPES.Wire)

Module CORE_TYPES.Wire

The core RPC logic can be used with different serialisation systems. The appropriate types should be provided here.

type request
type response
type 'a msg
module Path : sig ... end

A field in a message that refers to a capability.

module Request : WIRE_PAYLOAD with type t = request msg and type path := Path.t
module Response : sig ... end
val ref_leak_detected : int -> (unit -> unit) -> unit

ref_leak_detected thread_id fn is called when a promise or capability is GC'd while its ref-count is non-zero, indicating that resources may have been leaked. fn () will log a warning about this and free the resources itself. The reason for going via ref_leak_detected rather than calling fn directly is because the OCaml GC may detect the problem at any point (e.g. while we're sending another message). The implementation should arrange for fn to be called at a safe point in thread thread_id (e.g. when returning to the thread's main loop). Unit-tests may wish to call fn immediately to show the error and then fail the test.

diff --git a/capnp-rpc/Capnp_rpc_proto/S/module-type-CORE_TYPES/class-ref_counted/index.html b/capnp-rpc/Capnp_rpc_proto/S/module-type-CORE_TYPES/class-ref_counted/index.html index 6e302ff5..3cb62f43 100644 --- a/capnp-rpc/Capnp_rpc_proto/S/module-type-CORE_TYPES/class-ref_counted/index.html +++ b/capnp-rpc/Capnp_rpc_proto/S/module-type-CORE_TYPES/class-ref_counted/index.html @@ -1,2 +1,2 @@ -ref_counted (capnp-rpc.Capnp_rpc_proto.S.CORE_TYPES.ref_counted)

Class CORE_TYPES.ref_counted

A mix-in to help with writing reference-counted objects. It will call self#release when the ref-count reaches zero.

method private virtual release : unit
method virtual pp : Stdlib.Format.formatter -> unit
method private pp_refcount : Stdlib.Format.formatter -> unit

Write the current ref-count to the formatter (use with "%t").

method private check_refcount : unit

Raise an exception if the ref-count is less than one (i.e. check that the object hasn't already been freed).

method update_rc : int -> unit
method check_invariants : unit
method virtual blocker : base_ref option
method sealed_dispatch : 'a. 'a brand -> 'a option
+ref_counted (capnp-rpc.Capnp_rpc_proto.S.CORE_TYPES.ref_counted)

Class CORE_TYPES.ref_counted

A mix-in to help with writing reference-counted objects. It will call self#release when the ref-count reaches zero.

method private virtual release : unit
method virtual pp : Stdlib.Format.formatter -> unit
method private pp_refcount : Stdlib.Format.formatter -> unit

Write the current ref-count to the formatter (use with "%t").

method private check_refcount : unit

Raise an exception if the ref-count is less than one (i.e. check that the object hasn't already been freed).

method update_rc : int -> unit
method check_invariants : unit
method virtual blocker : base_ref option
method sealed_dispatch : 'a. 'a brand -> 'a option
diff --git a/capnp-rpc/Capnp_rpc_proto/S/module-type-CORE_TYPES/class-service/index.html b/capnp-rpc/Capnp_rpc_proto/S/module-type-CORE_TYPES/class-service/index.html index 4995c585..64b3a8e4 100644 --- a/capnp-rpc/Capnp_rpc_proto/S/module-type-CORE_TYPES/class-service/index.html +++ b/capnp-rpc/Capnp_rpc_proto/S/module-type-CORE_TYPES/class-service/index.html @@ -1,2 +1,2 @@ -service (capnp-rpc.Capnp_rpc_proto.S.CORE_TYPES.service)

Class CORE_TYPES.service

A convenience base class for creating local services. The capability is always resolved, and the default release method does nothing.

inherit base_ref
inherit ref_counted
method virtual call : struct_resolver -> Wire.Request.t -> unit
method shortest : cap
method private release : unit
method when_more_resolved : (cap -> unit) -> unit
method when_released : (unit -> unit) -> unit
method problem : Capnp_rpc_proto__.Exception.t option
+service (capnp-rpc.Capnp_rpc_proto.S.CORE_TYPES.service)

Class CORE_TYPES.service

A convenience base class for creating local services. The capability is always resolved, and the default release method does nothing.

inherit base_ref
inherit ref_counted
method virtual call : struct_resolver -> Wire.Request.t -> unit
method shortest : cap
method private release : unit
method when_more_resolved : (cap -> unit) -> unit
method when_released : (unit -> unit) -> unit
method problem : Capnp_rpc_proto__.Exception.t option
diff --git a/capnp-rpc/Capnp_rpc_proto/S/module-type-CORE_TYPES/class-type-base_ref/index.html b/capnp-rpc/Capnp_rpc_proto/S/module-type-CORE_TYPES/class-type-base_ref/index.html index 85fd3bd3..2daec012 100644 --- a/capnp-rpc/Capnp_rpc_proto/S/module-type-CORE_TYPES/class-type-base_ref/index.html +++ b/capnp-rpc/Capnp_rpc_proto/S/module-type-CORE_TYPES/class-type-base_ref/index.html @@ -1,2 +1,2 @@ -base_ref (capnp-rpc.Capnp_rpc_proto.S.CORE_TYPES.base_ref)

Class type CORE_TYPES.base_ref

Common methods for struct_ref and cap.

method pp : Stdlib.Format.formatter -> unit
method update_rc : int -> unit

c#update_rc d adds d to c's (local) reference count. When it reaches zero, c must not be used again. A message may be sent releasing any remote resources.

method blocker : base_ref option

c#blocker is the unresolved cap or struct_ref promise that must resolve for c to resolve. This is used to help detect cycles.

method check_invariants : unit

This is for debugging. Checks its own invariants and those of other base_refs it holds. Raises Invariant_broken if there is a problem.

method sealed_dispatch : 'a. 'a brand -> 'a option

c#sealed_dispatch brand extracts some private data of the given type.

+base_ref (capnp-rpc.Capnp_rpc_proto.S.CORE_TYPES.base_ref)

Class type CORE_TYPES.base_ref

Common methods for struct_ref and cap.

method pp : Stdlib.Format.formatter -> unit
method update_rc : int -> unit

c#update_rc d adds d to c's (local) reference count. When it reaches zero, c must not be used again. A message may be sent releasing any remote resources.

method blocker : base_ref option

c#blocker is the unresolved cap or struct_ref promise that must resolve for c to resolve. This is used to help detect cycles.

method check_invariants : unit

This is for debugging. Checks its own invariants and those of other base_refs it holds. Raises Invariant_broken if there is a problem.

method sealed_dispatch : 'a. 'a brand -> 'a option

c#sealed_dispatch brand extracts some private data of the given type.

diff --git a/capnp-rpc/Capnp_rpc_proto/S/module-type-CORE_TYPES/class-type-cap/index.html b/capnp-rpc/Capnp_rpc_proto/S/module-type-CORE_TYPES/class-type-cap/index.html index 5d2723ae..ee578365 100644 --- a/capnp-rpc/Capnp_rpc_proto/S/module-type-CORE_TYPES/class-type-cap/index.html +++ b/capnp-rpc/Capnp_rpc_proto/S/module-type-CORE_TYPES/class-type-cap/index.html @@ -1,2 +1,2 @@ -cap (capnp-rpc.Capnp_rpc_proto.S.CORE_TYPES.cap)

Class type CORE_TYPES.cap

A 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.

inherit base_ref
method call : struct_resolver -> Wire.Request.t -> unit

c#call results msg invokes a method on c's target and eventually resolves results with the answer.

method shortest : cap

c#shortest is the shortest known path to cap. i.e. if c is forwarding to another cap, we return that, recursively.

method when_more_resolved : (cap -> unit) -> unit

c#when_more_resolved fn calls fn x when this cap becomes more resolved. fn x gets a reference to x and needs to dec_ref it. Note that the new capability can be another promise. If c is already resolved to its final value, this does nothing. If c is a far-ref, fn x will be called when it breaks. If c is forwarding to another cap, it will forward this call. If c gets released before calling fn, it will never call it.

method when_released : (unit -> unit) -> unit

c#when_released fn will call fn () when c's ref-count drops to zero. This is used for caches, to remove entries when they become invalid. For promises, fn will be transferred to the resolution if resolved. For broken caps, this method does nothing (exceptions are never released).

method problem : Capnp_rpc_proto__.Exception.t option

c#problem is the exception for a broken reference, or None if it is not known to be broken.

+cap (capnp-rpc.Capnp_rpc_proto.S.CORE_TYPES.cap)

Class type CORE_TYPES.cap

A 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.

inherit base_ref
method call : struct_resolver -> Wire.Request.t -> unit

c#call results msg invokes a method on c's target and eventually resolves results with the answer.

method shortest : cap

c#shortest is the shortest known path to cap. i.e. if c is forwarding to another cap, we return that, recursively.

method when_more_resolved : (cap -> unit) -> unit

c#when_more_resolved fn calls fn x when this cap becomes more resolved. fn x gets a reference to x and needs to dec_ref it. Note that the new capability can be another promise. If c is already resolved to its final value, this does nothing. If c is a far-ref, fn x will be called when it breaks. If c is forwarding to another cap, it will forward this call. If c gets released before calling fn, it will never call it.

method when_released : (unit -> unit) -> unit

c#when_released fn will call fn () when c's ref-count drops to zero. This is used for caches, to remove entries when they become invalid. For promises, fn will be transferred to the resolution if resolved. For broken caps, this method does nothing (exceptions are never released).

method problem : Capnp_rpc_proto__.Exception.t option

c#problem is the exception for a broken reference, or None if it is not known to be broken.

diff --git a/capnp-rpc/Capnp_rpc_proto/S/module-type-CORE_TYPES/class-type-struct_ref/index.html b/capnp-rpc/Capnp_rpc_proto/S/module-type-CORE_TYPES/class-type-struct_ref/index.html index 660504a5..3daee3ca 100644 --- a/capnp-rpc/Capnp_rpc_proto/S/module-type-CORE_TYPES/class-type-struct_ref/index.html +++ b/capnp-rpc/Capnp_rpc_proto/S/module-type-CORE_TYPES/class-type-struct_ref/index.html @@ -1,2 +1,2 @@ -struct_ref (capnp-rpc.Capnp_rpc_proto.S.CORE_TYPES.struct_ref)

Class type CORE_TYPES.struct_ref

The 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.

inherit base_ref
method when_resolved : (Wire.Response.t or_error -> unit) -> unit

r#when_resolved fn queues up fn to be called on the result, when it arrives. If the result has already arrived, fn is called immediately.

method response : Wire.Response.t or_error option

r#response is Some payload if the response has arrived, or None if we're still waiting.

method cap : Wire.Path.t -> cap

r#cap path is the capability found at path in the response. If the response has arrived, this will extract the capability from it. If not, it may create a capability that will pipeline through the promised answer until the result arrives (at which point it will use the new, more direct route). The caller should call cap#dec_ref when done.

+struct_ref (capnp-rpc.Capnp_rpc_proto.S.CORE_TYPES.struct_ref)

Class type CORE_TYPES.struct_ref

The 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.

inherit base_ref
method when_resolved : (Wire.Response.t or_error -> unit) -> unit

r#when_resolved fn queues up fn to be called on the result, when it arrives. If the result has already arrived, fn is called immediately.

method response : Wire.Response.t or_error option

r#response is Some payload if the response has arrived, or None if we're still waiting.

method cap : Wire.Path.t -> cap

r#cap path is the capability found at path in the response. If the response has arrived, this will extract the capability from it. If not, it may create a capability that will pipeline through the promised answer until the result arrives (at which point it will use the new, more direct route). The caller should call cap#dec_ref when done.

diff --git a/capnp-rpc/Capnp_rpc_proto/S/module-type-CORE_TYPES/class-type-struct_resolver/index.html b/capnp-rpc/Capnp_rpc_proto/S/module-type-CORE_TYPES/class-type-struct_resolver/index.html index ce5ee760..6ab7c96f 100644 --- a/capnp-rpc/Capnp_rpc_proto/S/module-type-CORE_TYPES/class-type-struct_resolver/index.html +++ b/capnp-rpc/Capnp_rpc_proto/S/module-type-CORE_TYPES/class-type-struct_resolver/index.html @@ -1,2 +1,2 @@ -struct_resolver (capnp-rpc.Capnp_rpc_proto.S.CORE_TYPES.struct_resolver)

Class type CORE_TYPES.struct_resolver

A struct_resolver can be used to resolve some promise.

method pp : Stdlib.Format.formatter -> unit
method resolve : struct_ref -> unit

r#resolve x causes r's promise to behave as x in future. The promise takes ownership of x (is responsible for calling dec_rec on it).

method sealed_dispatch : 'a. 'a brand -> 'a option

r#sealed_dispatch brand extracts some private data of the given type.

method set_blocker : base_ref -> (unit, [> `Cycle ]) Stdlib.result

r#set_blocker b means that resolve won't be called until b is resolved. r's promise should report this as its blocker. This is needed to detect cycles. When the blocker is resolved, call this again with None to clear it (the promise will then report itself as the blocker again, until resolved).

method clear_blocker : unit

r#clear_blocker removes the blocker set by set_blocker. r is then blocked by itself, if unresolved.

+struct_resolver (capnp-rpc.Capnp_rpc_proto.S.CORE_TYPES.struct_resolver)

Class type CORE_TYPES.struct_resolver

A struct_resolver can be used to resolve some promise.

method pp : Stdlib.Format.formatter -> unit
method resolve : struct_ref -> unit

r#resolve x causes r's promise to behave as x in future. The promise takes ownership of x (is responsible for calling dec_rec on it).

method sealed_dispatch : 'a. 'a brand -> 'a option

r#sealed_dispatch brand extracts some private data of the given type.

method set_blocker : base_ref -> (unit, [> `Cycle ]) Stdlib.result

r#set_blocker b means that resolve won't be called until b is resolved. r's promise should report this as its blocker. This is needed to detect cycles. When the blocker is resolved, call this again with None to clear it (the promise will then report itself as the blocker again, until resolved).

method clear_blocker : unit

r#clear_blocker removes the blocker set by set_blocker. r is then blocked by itself, if unresolved.

diff --git a/capnp-rpc/Capnp_rpc_proto/S/module-type-CORE_TYPES/index.html b/capnp-rpc/Capnp_rpc_proto/S/module-type-CORE_TYPES/index.html index 3c61da52..847eedad 100644 --- a/capnp-rpc/Capnp_rpc_proto/S/module-type-CORE_TYPES/index.html +++ b/capnp-rpc/Capnp_rpc_proto/S/module-type-CORE_TYPES/index.html @@ -1,5 +1,5 @@ -CORE_TYPES (capnp-rpc.Capnp_rpc_proto.S.CORE_TYPES)

Module type S.CORE_TYPES

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.

module Wire : WIRE

The core RPC logic can be used with different serialisation systems. The appropriate types should be provided here.

type 'a or_error = ('a, Error.t) Stdlib.result
class type base_ref = object ... end

Common methods for struct_ref and cap.

val pp : base_ref Fmt.t
val inc_ref : base_ref -> unit

inc_ref x increases x's ref-count by one.

val dec_ref : base_ref -> unit

dec_ref x decreases x's ref-count by one.

class type struct_ref = object ... end

The 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 ... end

A 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 ... end

A struct_resolver can be used to resolve some promise.

module Attachments : sig ... end
module Request_payload : +CORE_TYPES (capnp-rpc.Capnp_rpc_proto.S.CORE_TYPES)

Module type S.CORE_TYPES

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.

module Wire : WIRE

The core RPC logic can be used with different serialisation systems. The appropriate types should be provided here.

type 'a or_error = ('a, Error.t) Stdlib.result
class type base_ref = object ... end

Common methods for struct_ref and cap.

val pp : base_ref Fmt.t
val inc_ref : base_ref -> unit

inc_ref x increases x's ref-count by one.

val dec_ref : base_ref -> unit

dec_ref x decreases x's ref-count by one.

class type struct_ref = object ... end

The 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 ... end

A 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 ... end

A struct_resolver can be used to resolve some promise.

module Attachments : sig ... end
module Request_payload : PAYLOAD with type t = Wire.Request.t and type cap := cap diff --git a/capnp-rpc/Capnp_rpc_proto/S/module-type-NETWORK_TYPES/index.html b/capnp-rpc/Capnp_rpc_proto/S/module-type-NETWORK_TYPES/index.html index f61c6ad8..3f65d611 100644 --- a/capnp-rpc/Capnp_rpc_proto/S/module-type-NETWORK_TYPES/index.html +++ b/capnp-rpc/Capnp_rpc_proto/S/module-type-NETWORK_TYPES/index.html @@ -1,2 +1,2 @@ -NETWORK_TYPES (capnp-rpc.Capnp_rpc_proto.S.NETWORK_TYPES)

Module type S.NETWORK_TYPES

type provision_id
type recipient_id
type third_party_cap_id
type join_key_part
+NETWORK_TYPES (capnp-rpc.Capnp_rpc_proto.S.NETWORK_TYPES)

Module type S.NETWORK_TYPES

type provision_id
type recipient_id
type third_party_cap_id
type join_key_part
diff --git a/capnp-rpc/Capnp_rpc_proto/S/module-type-PAYLOAD/index.html b/capnp-rpc/Capnp_rpc_proto/S/module-type-PAYLOAD/index.html index 2ed1ddb5..24394dd4 100644 --- a/capnp-rpc/Capnp_rpc_proto/S/module-type-PAYLOAD/index.html +++ b/capnp-rpc/Capnp_rpc_proto/S/module-type-PAYLOAD/index.html @@ -1,2 +1,2 @@ -PAYLOAD (capnp-rpc.Capnp_rpc_proto.S.PAYLOAD)

Module type S.PAYLOAD

Wraps WIRE_PAYLOAD to deal with caps rather than attachments.

type t
type cap
type path
val snapshot_caps : t -> cap RO_array.t
val field : t -> path -> cap option

field t path looks up path in the message and returns the capability at that index. Returns None if the field wasn't set. Returns a broken capability if an index was given but does not exist (i.e. the message is corrupted). Increases the ref-count on the result.

val with_caps : cap RO_array.t -> t -> t

with_caps caps t is a copy of t with a new set of capabilities. This is useful to implement TakeFromOtherQuestion, where the message is the same but embargoes may be needed, and to break cycles.

val release : t -> unit

release t frees all the capabilities attached to this message. It is safe to call this multiple times; only the first call has any effect.

val pp : t Fmt.t
+PAYLOAD (capnp-rpc.Capnp_rpc_proto.S.PAYLOAD)

Module type S.PAYLOAD

Wraps WIRE_PAYLOAD to deal with caps rather than attachments.

type t
type cap
type path
val snapshot_caps : t -> cap RO_array.t
val field : t -> path -> cap option

field t path looks up path in the message and returns the capability at that index. Returns None if the field wasn't set. Returns a broken capability if an index was given but does not exist (i.e. the message is corrupted). Increases the ref-count on the result.

val with_caps : cap RO_array.t -> t -> t

with_caps caps t is a copy of t with a new set of capabilities. This is useful to implement TakeFromOtherQuestion, where the message is the same but embargoes may be needed, and to break cycles.

val release : t -> unit

release t frees all the capabilities attached to this message. It is safe to call this multiple times; only the first call has any effect.

val pp : t Fmt.t
diff --git a/capnp-rpc/Capnp_rpc_proto/S/module-type-WIRE/Path/index.html b/capnp-rpc/Capnp_rpc_proto/S/module-type-WIRE/Path/index.html index 9ba8cf30..4e70054e 100644 --- a/capnp-rpc/Capnp_rpc_proto/S/module-type-WIRE/Path/index.html +++ b/capnp-rpc/Capnp_rpc_proto/S/module-type-WIRE/Path/index.html @@ -1,2 +1,2 @@ -Path (capnp-rpc.Capnp_rpc_proto.S.WIRE.Path)

Module WIRE.Path

A field in a message that refers to a capability.

include Stdlib.Map.OrderedType
type t
val compare : t -> t -> int
val root : t

The path for the bootstrap capability in the bootstrap message.

val pp : t Fmt.t
+Path (capnp-rpc.Capnp_rpc_proto.S.WIRE.Path)

Module WIRE.Path

A field in a message that refers to a capability.

include Stdlib.Map.OrderedType
type t
val compare : t -> t -> int
val root : t

The path for the bootstrap capability in the bootstrap message.

val pp : t Fmt.t
diff --git a/capnp-rpc/Capnp_rpc_proto/S/module-type-WIRE/Request/index.html b/capnp-rpc/Capnp_rpc_proto/S/module-type-WIRE/Request/index.html index 66c88441..2015a988 100644 --- a/capnp-rpc/Capnp_rpc_proto/S/module-type-WIRE/Request/index.html +++ b/capnp-rpc/Capnp_rpc_proto/S/module-type-WIRE/Request/index.html @@ -1,2 +1,2 @@ -Request (capnp-rpc.Capnp_rpc_proto.S.WIRE.Request)

Module WIRE.Request

type t = request msg

A message payload. This is typically a byte array of some kind, plus a way of attaching capabilities.

val pp : t Fmt.t
val cap_index : t -> Path.t -> int option

cap_index msg path is the capability index at path in the message (i.e the index of the capability in the attachments table).

val attachments : t -> attachments
val with_attachments : attachments -> t -> t
+Request (capnp-rpc.Capnp_rpc_proto.S.WIRE.Request)

Module WIRE.Request

type t = request msg

A message payload. This is typically a byte array of some kind, plus a way of attaching capabilities.

val pp : t Fmt.t
val cap_index : t -> Path.t -> int option

cap_index msg path is the capability index at path in the message (i.e the index of the capability in the attachments table).

val attachments : t -> attachments
val with_attachments : attachments -> t -> t
diff --git a/capnp-rpc/Capnp_rpc_proto/S/module-type-WIRE/Response/index.html b/capnp-rpc/Capnp_rpc_proto/S/module-type-WIRE/Response/index.html index 02aa9dbf..856f9cf9 100644 --- a/capnp-rpc/Capnp_rpc_proto/S/module-type-WIRE/Response/index.html +++ b/capnp-rpc/Capnp_rpc_proto/S/module-type-WIRE/Response/index.html @@ -1,2 +1,2 @@ -Response (capnp-rpc.Capnp_rpc_proto.S.WIRE.Response)

Module WIRE.Response

include WIRE_PAYLOAD with type t = response msg and type path := Path.t
type t = response msg

A message payload. This is typically a byte array of some kind, plus a way of attaching capabilities.

val pp : t Fmt.t
val cap_index : t -> Path.t -> int option

cap_index msg path is the capability index at path in the message (i.e the index of the capability in the attachments table).

val attachments : t -> attachments
val with_attachments : attachments -> t -> t
val bootstrap : unit -> t

The (empty) content for the reply to the bootstrap message.

+Response (capnp-rpc.Capnp_rpc_proto.S.WIRE.Response)

Module WIRE.Response

include WIRE_PAYLOAD with type t = response msg and type path := Path.t
type t = response msg

A message payload. This is typically a byte array of some kind, plus a way of attaching capabilities.

val pp : t Fmt.t
val cap_index : t -> Path.t -> int option

cap_index msg path is the capability index at path in the message (i.e the index of the capability in the attachments table).

val attachments : t -> attachments
val with_attachments : attachments -> t -> t
val bootstrap : unit -> t

The (empty) content for the reply to the bootstrap message.

diff --git a/capnp-rpc/Capnp_rpc_proto/S/module-type-WIRE/index.html b/capnp-rpc/Capnp_rpc_proto/S/module-type-WIRE/index.html index 73885336..ea947abb 100644 --- a/capnp-rpc/Capnp_rpc_proto/S/module-type-WIRE/index.html +++ b/capnp-rpc/Capnp_rpc_proto/S/module-type-WIRE/index.html @@ -1,2 +1,2 @@ -WIRE (capnp-rpc.Capnp_rpc_proto.S.WIRE)

Module type S.WIRE

The core RPC logic can be used with different serialisation systems. The appropriate types should be provided here.

type request
type response
type 'a msg
module Path : sig ... end

A field in a message that refers to a capability.

module Request : WIRE_PAYLOAD with type t = request msg and type path := Path.t
module Response : sig ... end
val ref_leak_detected : int -> (unit -> unit) -> unit

ref_leak_detected thread_id fn is called when a promise or capability is GC'd while its ref-count is non-zero, indicating that resources may have been leaked. fn () will log a warning about this and free the resources itself. The reason for going via ref_leak_detected rather than calling fn directly is because the OCaml GC may detect the problem at any point (e.g. while we're sending another message). The implementation should arrange for fn to be called at a safe point in thread thread_id (e.g. when returning to the thread's main loop). Unit-tests may wish to call fn immediately to show the error and then fail the test.

+WIRE (capnp-rpc.Capnp_rpc_proto.S.WIRE)

Module type S.WIRE

The core RPC logic can be used with different serialisation systems. The appropriate types should be provided here.

type request
type response
type 'a msg
module Path : sig ... end

A field in a message that refers to a capability.

module Request : WIRE_PAYLOAD with type t = request msg and type path := Path.t
module Response : sig ... end
val ref_leak_detected : int -> (unit -> unit) -> unit

ref_leak_detected thread_id fn is called when a promise or capability is GC'd while its ref-count is non-zero, indicating that resources may have been leaked. fn () will log a warning about this and free the resources itself. The reason for going via ref_leak_detected rather than calling fn directly is because the OCaml GC may detect the problem at any point (e.g. while we're sending another message). The implementation should arrange for fn to be called at a safe point in thread thread_id (e.g. when returning to the thread's main loop). Unit-tests may wish to call fn immediately to show the error and then fail the test.

diff --git a/capnp-rpc/Capnp_rpc_proto/S/module-type-WIRE_PAYLOAD/index.html b/capnp-rpc/Capnp_rpc_proto/S/module-type-WIRE_PAYLOAD/index.html index e03f59d1..4ff60dbc 100644 --- a/capnp-rpc/Capnp_rpc_proto/S/module-type-WIRE_PAYLOAD/index.html +++ b/capnp-rpc/Capnp_rpc_proto/S/module-type-WIRE_PAYLOAD/index.html @@ -1,2 +1,2 @@ -WIRE_PAYLOAD (capnp-rpc.Capnp_rpc_proto.S.WIRE_PAYLOAD)

Module type S.WIRE_PAYLOAD

type t

A message payload. This is typically a byte array of some kind, plus a way of attaching capabilities.

type path
val pp : t Fmt.t
val cap_index : t -> path -> int option

cap_index msg path is the capability index at path in the message (i.e the index of the capability in the attachments table).

val attachments : t -> attachments
val with_attachments : attachments -> t -> t
+WIRE_PAYLOAD (capnp-rpc.Capnp_rpc_proto.S.WIRE_PAYLOAD)

Module type S.WIRE_PAYLOAD

type t

A message payload. This is typically a byte array of some kind, plus a way of attaching capabilities.

type path
val pp : t Fmt.t
val cap_index : t -> path -> int option

cap_index msg path is the capability index at path in the message (i.e the index of the capability in the attachments table).

val attachments : t -> attachments
val with_attachments : attachments -> t -> t
diff --git a/capnp-rpc/Capnp_rpc_proto/Stats/index.html b/capnp-rpc/Capnp_rpc_proto/Stats/index.html index c0636714..2697db26 100644 --- a/capnp-rpc/Capnp_rpc_proto/Stats/index.html +++ b/capnp-rpc/Capnp_rpc_proto/Stats/index.html @@ -1,2 +1,2 @@ -Stats (capnp-rpc.Capnp_rpc_proto.Stats)

Module Capnp_rpc_proto.Stats

Statistics for CapTP connections.

type t = {
  1. n_questions : int;
  2. n_answers : int;
  3. n_imports : int;
  4. n_exports : int;
}
val zero : t
val pp : Stdlib.Format.formatter -> t -> unit
+Stats (capnp-rpc.Capnp_rpc_proto.Stats)

Module Capnp_rpc_proto.Stats

Statistics for CapTP connections.

type t = {
  1. n_questions : int;
  2. n_answers : int;
  3. n_imports : int;
  4. n_exports : int;
}
val zero : t
val pp : Stdlib.Format.formatter -> t -> unit
diff --git a/capnp-rpc/Capnp_rpc_proto/index.html b/capnp-rpc/Capnp_rpc_proto/index.html index 626c8ae4..5c6d888f 100644 --- a/capnp-rpc/Capnp_rpc_proto/index.html +++ b/capnp-rpc/Capnp_rpc_proto/index.html @@ -1,2 +1,2 @@ -Capnp_rpc_proto (capnp-rpc.Capnp_rpc_proto)

Module Capnp_rpc_proto

The abstract and untyped Cap'n Proto RPC protocol. Users will normally want to use the Capnp_rpc API instead, which provides a typed interface using the Cap'n Proto serialisation.

module S : sig ... end

The core types and module signatures.

module RO_array : sig ... end

A read-only array.

module Stats : sig ... end

Statistics for CapTP connections.

module Id : sig ... end

Unique identifiers.

module Debug : sig ... end

Diagnostics.

module Error : sig ... end

Errors returned by calls.

module Exception : sig ... end

Cap'n Proto exceptions.

module Message_types : sig ... end

This module defines the information in the messages that goes over the wire. These messages are turned into actual byte streams elsewhere.

module Core_types (W : S.WIRE) : S.CORE_TYPES with module Wire = W

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.

module Local_struct_promise : sig ... end

A local promise for a call response. Queues messages locally.

module Cap_proxy : sig ... end

A local promise for a capability. Queues messages locally.

module CapTP : sig ... end

The abstract Cap'n Proto RPC network protocol.

module RC : sig ... end

A ref-count type that raises an exception on overflow.

+Capnp_rpc_proto (capnp-rpc.Capnp_rpc_proto)

Module Capnp_rpc_proto

The abstract and untyped Cap'n Proto RPC protocol. Users will normally want to use the Capnp_rpc API instead, which provides a typed interface using the Cap'n Proto serialisation.

module S : sig ... end

The core types and module signatures.

module RO_array : sig ... end

A read-only array.

module Stats : sig ... end

Statistics for CapTP connections.

module Id : sig ... end

Unique identifiers.

module Debug : sig ... end

Diagnostics.

module Error : sig ... end

Errors returned by calls.

module Exception : sig ... end

Cap'n Proto exceptions.

module Message_types : sig ... end

This module defines the information in the messages that goes over the wire. These messages are turned into actual byte streams elsewhere.

module Core_types (W : S.WIRE) : S.CORE_TYPES with module Wire = W

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.

module Local_struct_promise : sig ... end

A local promise for a call response. Queues messages locally.

module Cap_proxy : sig ... end

A local promise for a capability. Queues messages locally.

module CapTP : sig ... end

The abstract Cap'n Proto RPC network protocol.

module RC : sig ... end

A ref-count type that raises an exception on overflow.

diff --git a/capnp-rpc/index.html b/capnp-rpc/index.html index f1b63ff3..29ea0aaf 100644 --- a/capnp-rpc/index.html +++ b/capnp-rpc/index.html @@ -1,2 +1,2 @@ -index (capnp-rpc.index)

capnp-rpc index

Library capnp-rpc

The entry point of this library is the module: Capnp_rpc.

Library capnp-rpc.proto

The entry point of this library is the module: Capnp_rpc_proto.

+index (capnp-rpc.index)

capnp-rpc index

Library capnp-rpc

The entry point of this library is the module: Capnp_rpc.

Library capnp-rpc.proto

The entry point of this library is the module: Capnp_rpc_proto.

diff --git a/index.html b/index.html index 74519494..055e3050 100644 --- a/index.html +++ b/index.html @@ -11,10 +11,9 @@

OCaml package documentation

    -
  1. capnp-rpc 2.0
  2. -
  3. capnp-rpc-lwt 2.0
  4. -
  5. capnp-rpc-net 2.0
  6. -
  7. capnp-rpc-unix 2.0
  8. +
  9. capnp-rpc 2.1
  10. +
  11. capnp-rpc-net 2.1
  12. +
  13. capnp-rpc-unix 2.1
diff --git a/odoc.support/odoc.css b/odoc.support/odoc.css index 15240b57..f0f22a14 100644 --- a/odoc.support/odoc.css +++ b/odoc.support/odoc.css @@ -1,7 +1,7 @@ @charset "UTF-8"; /* Copyright (c) 2016 The odoc contributors. All rights reserved. Distributed under the ISC license, see terms at the end of the file. - odoc 2.4.3 */ + odoc 2.4.4 */ /* Fonts */ /* noticia-text-regular - latin */