There are plenty of resources for the basics of Rust and for protocol buffers + gRPC, so I don’t want to waste your time with heavy introductions. I want to bring you to action as soon as possible.

If you’re here I’ll make a few assumptions about you.

  • You can write code in another language, but you have an interest in Rust
  • You have basic familiarity with the command line for simple tasks (like listing files with ls)
  • You used web service APIs like REST, GraphQL or gRPC in code you’ve written
  • You’ve skimmed through the  official protocol buffers (v3) docs at least once
  • You are looking for some example code that you can copy/paste and modify

Goals for the post

My goal is to walk through writing a small async Rust CLI application. It will take user input from a client, send it to a remote gRPC server, and return output to the client.

The finished code is available in my  rust-examples repo, as  cli-grpc-tonic-blocking. But I encourage you to follow along, as I will narrate changes while I make them.

#rustlang #grpc #rust

How to Build a single Binary gRPC server-client with Rust
10.25 GEEK