pub struct GeneratedFile {
pub name: String,
pub package: String,
pub kind: GeneratedFileKind,
pub content: String,
}Expand description
One generated output file.
Each .proto produces five content files (<stem>.rs,
<stem>.__view.rs, <stem>.__oneof.rs, <stem>.__view_oneof.rs,
<stem>.__ext.rs) and each proto package produces one
<dotted.pkg>.mod.rs stitcher that include!s the content files
and authors the pub mod __buffa { … } ancillary tree.
See DESIGN.md → “Generated code layout”.
Consumers normally only need to wire up the
GeneratedFileKind::PackageMod entries (one per package); the five
per-proto content kinds are reached transitively via include! from
the stitcher. Write all files to disk; build a module tree from only
the PackageMod ones.
Fields§
§name: StringThe output file path (e.g., "my.pkg.foo.rs" or "my.pkg.mod.rs").
package: StringThe proto package this file belongs to.
kind: GeneratedFileKindWhat this file contains. Build integrations only need to wire up
GeneratedFileKind::PackageMod files; everything else is reached
via include! from there.
content: StringThe generated Rust source code.