Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Source file message_types.ml
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168(** This module defines the information in the messages that goes over the wire.
These messages are turned into actual byte streams elsewhere. *)moduleEmbargoId=Id.Make()moduletypeTABLE_TYPES=sig(** 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. *)moduleQuestionId:Id.SmoduleAnswerId:Id.SmoduleImportId:Id.SmoduleExportId:Id.SendmoduleFlip(T:TABLE_TYPES)=struct(** [Flip T] is the types for the other end of [T]'s connection. *)moduleQuestionId=T.AnswerIdmoduleAnswerId=T.QuestionIdmoduleImportId=T.ExportIdmoduleExportId=T.ImportIdendmoduleMake(Core_types:S.CORE_TYPES)(Network:S.NETWORK_TYPES)(T:TABLE_TYPES)=struct(** 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. *)openCore_typesopenCore_types.WireincludeTtypethird_party_desc=Network.third_party_cap_id*ExportId.ttypemessage_target=[|`ReceiverHostedofImportId.t|`ReceiverAnswerofQuestionId.t*Wire.Path.t]typedesc=[message_target|`None|`SenderHostedofExportId.t|`SenderPromiseofExportId.t|`ThirdPartyHostedofthird_party_desc]letpp_descf=function|`None->Fmt.pff"None"|`Locallocal->Fmt.pff"Local:%t"local#pp|`ReceiverAnswer(x,p)->Fmt.pff"ReceiverAnswer:%a:%a"QuestionId.ppxPath.ppp|`ReceiverHostedx->Fmt.pff"ReceiverHosted:%a"ImportId.ppx|`ThirdPartyHosted_->Fmt.pff"ThirdPartyHosted"|`SenderHostedx->Fmt.pff"SenderHosted:%a"ExportId.ppx|`SenderPromisex->Fmt.pff"SenderPromise:%a"ExportId.ppxtypesend_results_to=[|`Caller|`Yourself|`ThirdPartyofNetwork.recipient_id]typereturn=[|Error.t|`ResultsofResponse.t*descRO_array.t|`ResultsSentElsewhere|`TakeFromOtherQuestionofQuestionId.t|`AcceptFromThirdParty]typedisembargo_request=[|`Loopbackofmessage_target*EmbargoId.t]letpp_returnf=function|`Results(_,descrs)->Fmt.pff"Results:%a"(RO_array.pppp_desc)descrs|`Exceptionex->Fmt.pff"Exception:%a"Exception.ppex|`Cancelled->Fmt.pff"Cancelled"|`ResultsSentElsewhere->Fmt.pff"ResultsSentElsewhere"|`TakeFromOtherQuestionqid->Fmt.pff"TakeFromSenderQuestion(%a)"QuestionId.ppqid|`AcceptFromThirdParty->Fmt.pff"AcceptFromThirdParty"letpp_disembargo_request:disembargo_requestFmt.t=funf->function|`Loopback(old_path,id)->Fmt.pff"senderLoopback request for %a (embargo_id = %a)"pp_descold_pathEmbargoId.ppidtypet=[|`AbortofException.t|`BootstrapofQuestionId.t*string|`CallofQuestionId.t*message_target*Request.t*descRO_array.t*send_results_to|`Finishof(QuestionId.t*bool)(* bool is release-caps *)|`ReleaseofImportId.t*int|`Disembargo_requestofdisembargo_request|`Disembargo_replyofmessage_target*EmbargoId.t|`Returnof(AnswerId.t*return*bool)(* bool is release-caps *)|`Resolveof(ExportId.t*(desc,Exception.t)result)](** A message sent over the network. *)letwith_qid_tagtags:t->_=function|`Finish(qid,_)|`Bootstrap(qid,_)|`Call(qid,_,_,_,_)|`Disembargo_request(`Loopback(`ReceiverAnswer(qid,_),_))|`Disembargo_reply(`ReceiverAnswer(qid,_),_)->Logs.Tag.addDebug.qid_tag(QuestionId.uint32qid)tags|`Return(aid,_,_)->Logs.Tag.addDebug.qid_tag(AnswerId.uint32aid)tags|`Abort_|`Disembargo_reply_|`Disembargo_request_|`Release_|`Resolve_->tagsletpp_results_tof=function|`Caller->()|`Yourself->Fmt.pff" (results to yourself)"|`ThirdParty_->Fmt.pff" (results to third party)"(** Describe message from the point of view of the receiver. *)letpp_recvpp_msg:tFmt.t=funf->function|`Abortex->Fmt.pff"Abort(%a)"Exception.ppex|`Bootstrap_->Fmt.pff"Bootstrap"|`Call(_,target,msg,caps,results_to)->Fmt.pff"Call %a.%a with %a%a"pp_desctargetpp_msgmsg(RO_array.pppp_desc)capspp_results_toresults_to|`Finish(_,release)->Fmt.pff"Finish (release_result_caps=%b)"release|`Release(id,count)->Fmt.pff"Release export %a (count=%d)"ImportId.ppidcount|`Disembargo_requestdisembargo_request->pp_disembargo_requestfdisembargo_request|`Disembargo_reply(x,id)->Fmt.pff"Disembargo reply for %a (embargo ID = %a)"pp_descxEmbargoId.ppid|`Return(_,return,release)->Fmt.pff"Return %a (release_param_caps = %b)"pp_returnreturnrelease|`Resolve(id,Okdesc)->Fmt.pff"Resolve export %a -> %a"ExportId.ppidpp_descdesc|`Resolve(id,Errore)->Fmt.pff"Resolve export %a -> %a"ExportId.ppidException.ppeendmoduletypeENDPOINT=sigmoduleCore_types:S.CORE_TYPESmoduleNetwork_types:S.NETWORK_TYPESmoduleTable:TABLE_TYPESmoduleOut:moduletypeofMake(Core_types)(Network_types)(Table)(** The type of messages sent by this endpoint. *)moduleIn:moduletypeofMake(Core_types)(Network_types)(Flip(Table))(** The type of messages received by this endpoint. *)endmoduleTable_types()=structmoduleQuestionId=Id.Make()moduleAnswerId=Id.Make()moduleImportId=Id.Make()moduleExportId=Id.Make()endmoduleEndpoint(Core_types:S.CORE_TYPES)(Network_types:S.NETWORK_TYPES)(Table:TABLE_TYPES)=structmoduleCore_types=Core_typesmoduleNetwork_types=Network_typesmoduleTable=TablemoduleOut=Make(Core_types)(Network_types)(Table)moduleIn=Make(Core_types)(Network_types)(Flip(Table))end