buffa_descriptor/lib.rs
1//! Protobuf descriptor types for buffa.
2//!
3//! This crate provides buffa-generated Rust types for the protobuf descriptor
4//! schema (`google/protobuf/descriptor.proto`) and the protoc plugin protocol
5//! (`google/protobuf/compiler/plugin.proto`). It is the foundation for both
6//! compile-time code generation (`buffa-codegen`) and runtime reflection.
7//!
8//! The types are self-hosted — generated by buffa-codegen itself — so there
9//! is no dependency on an external protobuf library. The only runtime
10//! dependency is `buffa`.
11//!
12//! # Modules
13//!
14//! - [`generated::descriptor`] — `FileDescriptorProto`, `DescriptorProto`,
15//! `FieldDescriptorProto`, `FeatureSet`, `Edition`, and the rest of
16//! `descriptor.proto`.
17//! - [`generated::compiler`] — `CodeGeneratorRequest`, `CodeGeneratorResponse`
18//! from `plugin.proto`.
19//!
20//! # Regenerating
21//!
22//! The generated code is checked in. To regenerate (after a codegen output
23//! change or a protobuf version bump):
24//!
25//! ```sh
26//! task gen-bootstrap-types
27//! ```
28
29#![cfg_attr(not(feature = "std"), no_std)]
30
31extern crate alloc;
32
33mod desc;
34pub mod features;
35pub mod generated;
36#[cfg(feature = "reflect")]
37pub mod pool;
38#[cfg(feature = "reflect")]
39pub mod reflect;
40
41pub use desc::{
42 EnumDescriptor, EnumIndex, EnumValueDescriptor, ExtensionDescriptor, ExtensionIndex,
43 FieldDescriptor, FieldKind, MessageDescriptor, MessageIndex, MethodDescriptor, OneofDescriptor,
44 ScalarType, ServiceDescriptor, ServiceIndex, SingularKind,
45};
46#[cfg(feature = "reflect")]
47pub use pool::{DescriptorPool, PoolError};
48#[cfg(all(feature = "reflect", feature = "json"))]
49pub use reflect::DynamicMessageSeed;
50#[cfg(feature = "reflect")]
51pub use reflect::{
52 AnyError, DynamicMessage, MapKey, MapKeyRef, MapValue, ReflectCow, ReflectElement, ReflectList,
53 ReflectMap, ReflectMapKey, ReflectMessage, ReflectMessageMut, ReflectMode, Reflectable, Value,
54 ValueRef,
55};