Issuing RPCs
In this part, you will send requests to your server by invoking RPCs from the client.
Currently, src/client.rs
contains an example
function for sending an Example
RPC. In a similar manner, implement the echo
function to first connect to the server, then send an ECHO
RPC.
To retrieve an EchoReply
from a Response<EchoReply>
, you may find the into_inner
function useful.
Hint: You may want to take a look at how the example
function recovers an ExampleReply
from a Response<ExampleReply>
.
You should now be able to run ./target/debug/client echo test
and get an output of test
. Make sure you compile your code with cargo b
and that your server is running first.