Expand description
Shared code generation logic for buffa.
This crate takes protobuf descriptors (google.protobuf.FileDescriptorProto,
decoded from binary FileDescriptorSet data) and emits Rust source code
that uses the buffa runtime.
It is used by:
protoc-gen-buffa(protoc plugin)buffa-build(build.rs integration)
§Architecture
The code generator is intentionally decoupled from how descriptors are
obtained. It receives fully-resolved FileDescriptorProtos and produces
Rust source strings. This means:
- It doesn’t parse
.protofiles. - It doesn’t invoke
protoc. - It doesn’t do import resolution or name linking.
All of that is handled upstream (by protoc, buf, or a future parser).
Modules§
- context
- Code generation context and descriptor-to-Rust mapping state.
- idents
- Rust identifier and path construction helpers.
Structs§
- Code
GenConfig - Configuration for code generation.
- Generated
File - Result of generating Rust code for a single
.protofile.
Enums§
- Code
GenError - Code generation error.
Functions§
- generate
- Generate Rust source files from a set of file descriptors.
- generate_
module_ tree - Generate a module tree that assembles generated
.rsfiles into nestedpub modblocks matching the protobuf package hierarchy. - proto_
path_ to_ rust_ module - Convert a
.protofile path to a Rust module file name.