Skip to main content

buffa_descriptor/generated/
mod.rs

1//! Generated protobuf descriptor types.
2//!
3//! These types are generated from `google/protobuf/descriptor.proto` and
4//! `google/protobuf/compiler/plugin.proto` using buffa-codegen itself.
5//! This makes buffa fully self-hosted — no external protobuf library is
6//! needed to decode descriptors — and gives direct access to edition
7//! features (`FeatureSet`, `Edition`, etc.).
8//!
9//! To regenerate, run `task gen-bootstrap-types` from the repo root.
10//!
11//! The module tree mirrors the proto package nesting
12//! (`google.protobuf.compiler` is a child of `google.protobuf`), so the
13//! `super::*` cross-package references the codegen emits resolve without
14//! re-export workarounds — `compiler::*` reaching for
15//! `super::FileDescriptorProto` lands directly in the parent module, and
16//! `compiler::__buffa::view::*` reaching for
17//! `super::super::super::__buffa::view::FileDescriptorProtoView` does too.
18//! The sibling-style `crate::generated::compiler::*` path used by
19//! downstream consumers (and by `buffa-codegen`'s file-level extern routing
20//! for `google/protobuf/compiler/plugin.proto`) is preserved with a
21//! `pub use`.
22
23#[allow(
24    clippy::all,
25    dead_code,
26    missing_docs,
27    unused_imports,
28    unreachable_patterns,
29    non_camel_case_types
30)]
31pub mod descriptor {
32    // Re-export the buffa crate so `::buffa::` paths in generated code resolve.
33    use buffa;
34    include!("google.protobuf.mod.rs");
35
36    #[allow(
37        clippy::all,
38        dead_code,
39        missing_docs,
40        unused_imports,
41        unreachable_patterns,
42        non_camel_case_types
43    )]
44    pub mod compiler {
45        use buffa;
46        include!("google.protobuf.compiler.mod.rs");
47    }
48}
49
50/// `google.protobuf.compiler` types — `CodeGeneratorRequest`,
51/// `CodeGeneratorResponse`, `Version`. Re-exported here for the stable
52/// `::buffa_descriptor::generated::compiler` path; the module proper lives
53/// at [`descriptor::compiler`] so `super::*` cross-package references in the
54/// generated code resolve through the proto package nesting.
55pub use descriptor::compiler;
56
57// Re-export the specific descriptor types referenced from `super::` by the
58// compiler package — kept for backward compat with the previous flat module
59// layout where `compiler` was a sibling of `descriptor`.
60#[allow(unused_imports)]
61pub use descriptor::{FileDescriptorProto, GeneratedCodeInfo};