Skip to main content

generate

Function generate 

Source
pub fn generate(
    file_descriptors: &[FileDescriptorProto],
    files_to_generate: &[String],
    config: &CodeGenConfig,
) -> Result<Vec<GeneratedFile>, CodeGenError>
Expand description

Generate Rust source files from a set of file descriptors.

files_to_generate is the set of file names that were explicitly requested (matching CodeGeneratorRequest.file_to_generate). Descriptors for dependencies may be present in file_descriptors but won’t produce output files unless they appear in files_to_generate.

Each .proto emits five content files; each distinct package emits one <pkg>.mod.rs stitcher. Packages are processed in sorted order for deterministic output.