Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Source file s.ml
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145(** Module signatures. *)openCapnp_rpc_lwtmoduletypeADDRESS=sigtypet(** A network address at which a vat can be reached. *)valparse_uri:Uri.t->((t*string),[>`Msgofstring])result(** [parse_uri uri] extracts from a URI the network address and service ID. *)valto_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]. *)valequal:t->t->boolvaldigest:t->Auth.Digest.t(** How to verify that the correct address has been reached. *)valpp:tFmt.tendmoduletypeNETWORK=sigmoduleTypes:Capnp_rpc.S.NETWORK_TYPESmoduleAddress:ADDRESStypetvalconnect:t->switch:Lwt_switch.t->secret_key:Auth.Secret_key.tLazy.t->Address.t->(Endpoint.t,[>`Msgofstring])resultLwt.t(** [connect t ~switch ~secret_key address] connects to [address], proves ownership of
[secret_key] (if TLS is being used), and returns the resulting endpoint.
Returns an error if no connection can be established or the target fails
to authenticate itself.
If [switch] is turned off, the connection should be terminated. *)valparse_third_party_cap_id:Private.Schema.Reader.pointer_t->Types.third_party_cap_idendmoduletypeVAT_NETWORK=sig(** Stretching capability references across a network link.
Note: see {!module:Capnp_rpc_unix} for a higher-level wrapper for this API. *)type+'acapability(** An ['a capability] is a capability reference to a service of type ['a]. *)typeflow(** A bi-directional byte-stream. *)typerestorer(** A function for restoring persistent capabilities from sturdy ref service IDs. *)type+'asturdy_ref(** An off-line (persistent) capability. *)typeservice_id(** A (secret) token that identifies a persistent service within a vat and grants access to it. *)moduleNetwork:NETWORK(** Sharing capabilities over a network link. *)moduleCapTP:sigtypet(** A CapTP connection to a remote peer. *)valconnect:restore:restorer->?tags:Logs.Tag.set->Endpoint.t->t(** [connect ~restore ~switch endpoint] is fresh CapTP protocol handler that sends and
receives messages using [endpoint].
[restore] is used to respond to "Bootstrap" messages.
If the connection fails then [endpoint] will be disconnected. *)valbootstrap:t->service_id->'acapability(** [bootstrap t object_id] is the peer's bootstrap object [object_id], if any.
Use [object_id = ""] for the main, public object. *)valdisconnect:t->Capnp_rpc.Exception.t->unitLwt.t(** [disconnect reason] closes the connection, sending [reason] to the peer to explain why.
Capabilities and questions at both ends will break, with [reason] as the problem. *)valdump:tFmt.t(** [dump] dumps the state of the connection, for debugging. *)end(** A Vat is an actor in the CapTP network, composed of
objects that can call each other directly. *)moduleVat:sig(** 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 {!module:Capnp_rpc_unix} module for a higher-level API. *)typet(** A local Vat. *)valcreate:?switch:Lwt_switch.t->?tags:Logs.Tag.set->?restore:restorer->?address:Network.Address.t->secret_key:Auth.Secret_key.tLazy.t->Network.t->t(** [create ~switch ~restore ~address ~secret_key network] is a new Vat that
uses [restore] to restore sturdy refs hosted at this vat to live
capabilities for peers.
The Vat will suggest that other parties connect to it using [address].
Turning off the switch will disconnect any active connections. *)valadd_connection:t->switch:Lwt_switch.t->mode:[`Accept|`Connect]->Endpoint.t->CapTP.tLwt.t(** [add_connection t ~switch ~mode endpoint] runs the CapTP protocol over [endpoint],
which is a connection to another vat.
When the connection ends, [switch] will be turned off, and turning off [switch] will
end the connection.
[mode] is used if two Vats connect to each other at the same time to
decide which connection to drop. Use [`Connect] if [t] initiated the new
connection. Note that [add_connection] may return an existing connection. *)valpublic_address:t->Network.Address.toption(** [public_address t] is the address that peers should use when connecting
to this Vat to locate and authenticate it. *)valsturdy_ref:t->service_id->'asturdy_ref(** [sturdy_ref t service_id] is a sturdy ref for [service_id], hosted at this Vat.
Fails if this Vat does not accept incoming connections. *)valexport:t->'asturdy_ref->Uri.t(** [export t sr] turns [sr] into a URI, which can be displayed and imported into another Vat. *)valsturdy_uri:t->service_id->Uri.t(** [sturdy_uri t id] is [sturdy_ref t id |> export t]. *)valimport:t->Uri.t->('asturdy_ref,[>`Msgofstring])result(** [import t uri] parses [uri] as a "capnp://" URI. *)valimport_exn:t->Uri.t->'asturdy_ref(** [import_exn] is a wrapper for [import] that raises an exception if it fails. *)valdump:tFmt.tendend