Protocol Buffers and Rust - example

Mar 31, 2019

A quick basic example of Protocol Buffers and Rust.

Final Example

The final example is found on GitHub here.


Add a dependency to the profobuf crate

protobuf = "2.4.2"

Build Dependencies

Add a build dependency to the profobuf codegen crate

protobuf-codegen-pure = "2.4.2"

Add the proto files

Add one or more proto file as per the Language Guide.

Add a file, using the basic sample from the codegen readme.

Paying attention to the out_dir, input and includes names/paths.