tonic-build

Compiles proto files via prost and generates service stubs and proto definitiones for use with tonic.

Features

Required dependencies

```toml [dependencies] bytes = tonic = prost =

[build-dependencies] tonic-build = ```

Examples

Simple

rust fn main() -> Result<(), Box<dyn std::error::Error>> { tonic_build::compile_protos("proto/service.proto")?; Ok(()) }

Configuration

rust fn main() -> Result<(), Box<dyn std::error::Error>> { tonic_build::configure() .build_server(false) .compile( &["proto/helloworld/helloworld.proto"], &["proto/helloworld"], )?; Ok(()) }