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.

Enable the output to be formated by rustfmt.

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 mods. Matches on the package name.

Add additional attribute to matched service servers. Matches on the service name.

Add additional attribute to matched client mods. 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.

Compile the .proto files and execute code generation.

Compile the .proto files and execute code generation using a custom prost_build::Config.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into #41263)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.