Skip to main content

Crate buffa_build

Crate buffa_build 

Source
Expand description

Build-time integration for buffa.

Use this crate in your build.rs to compile .proto files into Rust code at build time. Parses .proto files into a FileDescriptorSet (via protoc or buf), then uses buffa-codegen to generate Rust source.

§Example

// build.rs
fn main() {
    buffa_build::Config::new()
        .files(&["proto/my_service.proto"])
        .includes(&["proto/"])
        .compile()
        .unwrap();
}

§Requirements

By default, requires protoc on the system PATH (or set via the PROTOC environment variable) — the same as prost-build and tonic-build.

If protoc is unavailable or outdated on your platform, buf can be used instead — see Config::use_buf(). Alternatively, feed a pre-compiled descriptor set via Config::descriptor_set().

Structs§

CodeGenConfig
Configuration for code generation.
Config
Builder for configuring and running protobuf compilation.
FeatureGateNames
Crate feature names used by the gated impls, customizable per impl kind.

Enums§

BytesRepr
The Rust type a proto bytes field maps to in generated owned structs.
MapRepr
The owned Rust collection a proto map<K, V> field maps to in generated owned structs.
PointerRepr
The owned smart pointer a singular message field’s buffa::MessageField wraps in generated owned structs.
ReflectMode
How much reflection support generated types get.
RepeatedRepr
The owned Rust collection a proto repeated field maps to in generated owned structs.
StringRepr
The Rust type a proto string field maps to in generated owned structs.