Struct heph::actor_ref::rpc::RpcMessage [−][src]
pub struct RpcMessage<Req, Res> { pub request: Req, pub response: RpcResponse<Res>, }
Expand description
Message type that holds an RPC request.
It holds both the request (Req
) and the way to respond RpcResponse
.
Fields
request: Req
The request object.
response: RpcResponse<Res>
A way to respond
to the call.
Implementations
Convenience method to handle a Req
uest and return a Res
ponse.
The function f
is called with self.request
, the response returned by
the function f
is than returned to the request maker via
self.response.respond
.
Notes
If the receiving end is no longer connected the function f
is not
called and Ok(())
is returned instead.