Skip to main content Link Menu Expand (external link) Document Search Copy Copied

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. 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.