Struct tonic_build::Builder [−][src]
pub struct Builder { /* fields omitted */ }
Expand description
Service generator builder.
Implementations
Enable or disable gRPC client code generation.
Enable or disable gRPC server code generation.
Generate a file containing the encoded prost_types::FileDescriptorSet
for protocol buffers
modules. This is required for implementing gRPC Server Reflection.
Set the output directory to generate code to.
Defaults to the OUT_DIR
environment variable.
Declare externally provided Protobuf package or type.
Passed directly to prost_build::Config.extern_path
.
Note that both the Protobuf path and the rust package paths should both be fully qualified.
i.e. Protobuf paths should start with “.” and rust paths should start with “::”
Add additional attribute to matched messages, enums, and one-offs.
Passed directly to prost_build::Config.field_attribute
.
Add additional attribute to matched messages, enums, and one-offs.
Passed directly to prost_build::Config.type_attribute
.
Add additional attribute to matched server mod
s. Matches on the package name.
Add additional attribute to matched service servers. Matches on the service name.
Add additional attribute to matched client mod
s. Matches on the package name.
Add additional attribute to matched service clients. Matches on the service name.
Set the path to where tonic will search for the Request/Response proto structs
live relative to the module where you call include_proto!
.
This defaults to super
since tonic will generate code in a module.
Configure Prost protoc_args
build arguments.
Note: Enabling --experimental_allow_proto3_optional
requires protobuf >= 3.12.
Emits GRPC endpoints with no attached package. Effectively ignores protofile package declaration from grpc context.
This effectively sets prost’s exported package to an empty string.
Enable or disable directing Prost to compile well-known protobuf types instead
of using the already-compiled versions available in the prost-types
crate.
This defaults to false
.
Configures the optional module filename for easy inclusion of all generated Rust files
If set, generates a file (inside the OUT_DIR
or out_dir()
as appropriate) which contains
a set of pub mod XXX
statements combining to load all Rust files generated. This can allow
for a shortcut where multiple related proto files have been compiled together resulting in
a semi-complex set of includes.
Compile the .proto files and execute code generation.