diff --git a/src/examples/build_server.ml.expected b/src/examples/build_server.ml.expected index fcf285b7..ef537783 100644 --- a/src/examples/build_server.ml.expected +++ b/src/examples/build_server.ml.expected @@ -118,7 +118,7 @@ module BuildServer = struct module Client = struct open Pbrt_services - let make : (file_path, unary, empty, unary) Client.rpc = + let make_ : (file_path, unary, empty, unary) Client.rpc = (Client.mk_rpc ~package:[] ~service_name:"BuildServer" ~rpc_name:"make" @@ -134,7 +134,7 @@ module BuildServer = struct module Server = struct open Pbrt_services - let _rpc_make : (file_path,unary,empty,unary) Server.rpc = + let make_ : (file_path,unary,empty,unary) Server.rpc = (Server.mk_rpc ~name:"make" ~req_mode:Server.Unary ~res_mode:Server.Unary @@ -145,13 +145,13 @@ module BuildServer = struct () : _ Server.rpc) let make - ~make + ~make_:__handler__make_ () : _ Server.t = { Server. service_name="BuildServer"; package=[]; handlers=[ - (make _rpc_make); + (__handler__make_ make_); ]; } end diff --git a/src/examples/build_server.mli.expected b/src/examples/build_server.mli.expected index 7216abfb..a3c74679 100644 --- a/src/examples/build_server.mli.expected +++ b/src/examples/build_server.mli.expected @@ -80,13 +80,17 @@ module BuildServer : sig module Client : sig - val make : (file_path, unary, empty, unary) Client.rpc + val make_ : (file_path, unary, empty, unary) Client.rpc end module Server : sig (** Produce a server implementation from handlers *) val make : - make:((file_path, unary, empty, unary) Server.rpc -> 'handler) -> + make_:((file_path, unary, empty, unary) Server.rpc -> 'handler) -> unit -> 'handler Pbrt_services.Server.t + + (** The individual server stubs are only exposed for advanced users. Casual users should prefer accessing them through {!make}. *) + + val make_ : (file_path,unary,empty,unary) Server.rpc end end diff --git a/src/examples/calculator.ml.expected b/src/examples/calculator.ml.expected index a8f72cd4..aa1ff3e7 100644 --- a/src/examples/calculator.ml.expected +++ b/src/examples/calculator.ml.expected @@ -363,7 +363,7 @@ module Calculator = struct module Server = struct open Pbrt_services - let _rpc_add : (add_req,unary,i32,unary) Server.rpc = + let add : (add_req,unary,i32,unary) Server.rpc = (Server.mk_rpc ~name:"add" ~req_mode:Server.Unary ~res_mode:Server.Unary @@ -373,7 +373,7 @@ module Calculator = struct ~decode_pb_req:decode_pb_add_req () : _ Server.rpc) - let _rpc_add_all : (add_all_req,unary,i32,unary) Server.rpc = + let add_all : (add_all_req,unary,i32,unary) Server.rpc = (Server.mk_rpc ~name:"add_all" ~req_mode:Server.Unary ~res_mode:Server.Unary @@ -383,7 +383,7 @@ module Calculator = struct ~decode_pb_req:decode_pb_add_all_req () : _ Server.rpc) - let _rpc_ping : (empty,unary,empty,unary) Server.rpc = + let ping : (empty,unary,empty,unary) Server.rpc = (Server.mk_rpc ~name:"ping" ~req_mode:Server.Unary ~res_mode:Server.Unary @@ -393,7 +393,7 @@ module Calculator = struct ~decode_pb_req:decode_pb_empty () : _ Server.rpc) - let _rpc_get_pings : (empty,unary,i32,unary) Server.rpc = + let get_pings : (empty,unary,i32,unary) Server.rpc = (Server.mk_rpc ~name:"get_pings" ~req_mode:Server.Unary ~res_mode:Server.Unary @@ -404,19 +404,19 @@ module Calculator = struct () : _ Server.rpc) let make - ~add - ~add_all - ~ping - ~get_pings + ~add:__handler__add + ~add_all:__handler__add_all + ~ping:__handler__ping + ~get_pings:__handler__get_pings () : _ Server.t = { Server. service_name="Calculator"; package=[]; handlers=[ - (add _rpc_add); - (add_all _rpc_add_all); - (ping _rpc_ping); - (get_pings _rpc_get_pings); + (__handler__add add); + (__handler__add_all add_all); + (__handler__ping ping); + (__handler__get_pings get_pings); ]; } end diff --git a/src/examples/calculator.mli.expected b/src/examples/calculator.mli.expected index a74c2630..0795c713 100644 --- a/src/examples/calculator.mli.expected +++ b/src/examples/calculator.mli.expected @@ -169,5 +169,15 @@ module Calculator : sig ping:((empty, unary, empty, unary) Server.rpc -> 'handler) -> get_pings:((empty, unary, i32, unary) Server.rpc -> 'handler) -> unit -> 'handler Pbrt_services.Server.t + + (** The individual server stubs are only exposed for advanced users. Casual users should prefer accessing them through {!make}. *) + + val add : (add_req,unary,i32,unary) Server.rpc + + val add_all : (add_all_req,unary,i32,unary) Server.rpc + + val ping : (empty,unary,empty,unary) Server.rpc + + val get_pings : (empty,unary,i32,unary) Server.rpc end end diff --git a/src/examples/file_server.ml.expected b/src/examples/file_server.ml.expected index 9c38cb4f..324b4cca 100644 --- a/src/examples/file_server.ml.expected +++ b/src/examples/file_server.ml.expected @@ -395,7 +395,7 @@ module FileServer = struct module Server = struct open Pbrt_services - let _rpc_touch_file : (file_path,unary,empty,unary) Server.rpc = + let touch_file : (file_path,unary,empty,unary) Server.rpc = (Server.mk_rpc ~name:"touch_file" ~req_mode:Server.Unary ~res_mode:Server.Unary @@ -405,7 +405,7 @@ module FileServer = struct ~decode_pb_req:decode_pb_file_path () : _ Server.rpc) - let _rpc_upload_file : (file_chunk,stream,file_crc,unary) Server.rpc = + let upload_file : (file_chunk,stream,file_crc,unary) Server.rpc = (Server.mk_rpc ~name:"upload_file" ~req_mode:Server.Stream ~res_mode:Server.Unary @@ -415,7 +415,7 @@ module FileServer = struct ~decode_pb_req:decode_pb_file_chunk () : _ Server.rpc) - let _rpc_download_file : (file_path,unary,file_chunk,stream) Server.rpc = + let download_file : (file_path,unary,file_chunk,stream) Server.rpc = (Server.mk_rpc ~name:"download_file" ~req_mode:Server.Unary ~res_mode:Server.Stream @@ -425,7 +425,7 @@ module FileServer = struct ~decode_pb_req:decode_pb_file_path () : _ Server.rpc) - let _rpc_ping_pong : (ping,stream,pong,stream) Server.rpc = + let ping_pong : (ping,stream,pong,stream) Server.rpc = (Server.mk_rpc ~name:"ping_pong" ~req_mode:Server.Stream ~res_mode:Server.Stream @@ -436,19 +436,19 @@ module FileServer = struct () : _ Server.rpc) let make - ~touch_file - ~upload_file - ~download_file - ~ping_pong + ~touch_file:__handler__touch_file + ~upload_file:__handler__upload_file + ~download_file:__handler__download_file + ~ping_pong:__handler__ping_pong () : _ Server.t = { Server. service_name="FileServer"; package=[]; handlers=[ - (touch_file _rpc_touch_file); - (upload_file _rpc_upload_file); - (download_file _rpc_download_file); - (ping_pong _rpc_ping_pong); + (__handler__touch_file touch_file); + (__handler__upload_file upload_file); + (__handler__download_file download_file); + (__handler__ping_pong ping_pong); ]; } end diff --git a/src/examples/file_server.mli.expected b/src/examples/file_server.mli.expected index 197f2bb7..5188e043 100644 --- a/src/examples/file_server.mli.expected +++ b/src/examples/file_server.mli.expected @@ -191,5 +191,15 @@ module FileServer : sig download_file:((file_path, unary, file_chunk, stream) Server.rpc -> 'handler) -> ping_pong:((ping, stream, pong, stream) Server.rpc -> 'handler) -> unit -> 'handler Pbrt_services.Server.t + + (** The individual server stubs are only exposed for advanced users. Casual users should prefer accessing them through {!make}. *) + + val touch_file : (file_path,unary,empty,unary) Server.rpc + + val upload_file : (file_chunk,stream,file_crc,unary) Server.rpc + + val download_file : (file_path,unary,file_chunk,stream) Server.rpc + + val ping_pong : (ping,stream,pong,stream) Server.rpc end end