#cargo-build #prost-build #protoc #proto #buffer #protocols #path

ntex-prost-build

A Protocol Buffers implementation for the Rust Language

26 releases

new 0.11.14 Dec 6, 2024
0.11.13 Dec 15, 2023
0.11.11 Sep 10, 2023
0.11.10 May 3, 2023
0.10.6 Jul 8, 2022

#1637 in Network programming

Download history 28/week @ 2024-09-23 133/week @ 2024-12-02

133 downloads per month
Used in ntex-grpc-codegen

Apache-2.0

120KB
2.5K SLoC

Documentation Crate

prost-build

prost-build makes it easy to generate Rust code from .proto files as part of a Cargo build. See the crate documentation for examples of how to integrate prost-build into a Cargo project.

protoc

prost-build uses protoc to parse the proto files. There are a few ways to make protoc available for prost-build.

The first option is to include protoc in your PATH this can be done by following the protoc install instructions. In addition, its possible to pass the PROTOC=<my/path/to/protoc> environment variable.

The second option is to provide the vendored feature flag to prost-build. This will force prost-build to compile protoc from the bundled source. This will require that you have the correct dependencies installed include a C++ toolchain, cmake, etc. For more info on what the required dependencies are check here.

If you would like to always ignore vendoring protoc you can additionally pass PROTOC_NO_VENDOR and this will always check the PATH/PROTOC environment variables and never compile protoc from source.

License

prost-build is distributed under the terms of the Apache License (Version 2.0).

See LICENSE for details.

Copyright 2017 Dan Burkert

Dependencies

~7–17MB
~243K SLoC