Skip to main content

Crate tonic_prost_build

Crate tonic_prost_build 

Source
Expand description

Prost build integration for tonic.

This crate provides code generation for gRPC services using protobuf definitions via the prost ecosystem.

§Example

use tonic_prost_build::configure;

fn main() {
    configure()
        .compile_protos(&["proto/service.proto"], &["proto"])
        .unwrap();
}

Modules§

manual
This module provides utilities for generating tonic service stubs and clients purely in Rust without the need of proto files. It also enables you to set a custom Codec if you want to use a custom serialization format other than protobuf.

Structs§

Builder
Builder for configuring and generating code from .proto files.
Config
Configuration options for Protobuf code generation.
FileDescriptorSet
The protocol compiler can output a FileDescriptorSet containing the .proto files it parses.
TonicAttributes
Attributes that will be added to mod and struct items.

Constants§

NON_PATH_TYPE_ALLOWLIST
Chosen allowlist, which would be [EXTENDED_NON_PATH_TYPE_ALLOWLIST] if Builder::with_extended_rust_types was called.

Traits§

TonicMethod
Method generation trait.
TonicService
Service generation trait.

Functions§

compile_fds
Simple file descriptor set compiling. Use configure instead if you need more options.
compile_protos
Simple .proto compiling. Use configure instead if you need more options.
configure
Configure tonic-prost-build code generation.