Skip to main content

Crate oxiproto_codegen

Crate oxiproto_codegen 

Source
Expand description

oxiproto-codegen — Generate plain Rust source code from a FileDescriptorSet.

This crate walks a prost_types::FileDescriptorSet and emits plain Rust structs and enums — no prost derive, no gRPC stubs, no validators.

§Quick start

use prost_types::FileDescriptorSet;

let fds: FileDescriptorSet = /* parse your .proto */ Default::default();
let rust_src = oxiproto_codegen::generate(&fds).expect("codegen failed");
println!("{rust_src}");

Modules§

wkt_map
Mapping from proto well-known type FQNs to Rust type paths.

Structs§

CodegenOptions
Options controlling code generation from a FileDescriptorSet.
ModuleTree
Structured representation of generated Rust code grouped into a module hierarchy.

Enums§

CodegenError
Errors produced during code generation.

Functions§

emit_file_descriptor_set
Emit Rust source code from a FileDescriptorSet.
emit_file_descriptor_set_with_options
Emit Rust source code from a FileDescriptorSet with custom options.
generate
Generate Rust source code from a FileDescriptorSet.
generate_module
Generate a structured module tree from a FileDescriptorSet.
generate_to_file
Write generated code to a file path.
generate_to_file_with_options
Write generated code to a file path with custom options.
generate_to_writer
Stream generated code into any std::io::Write sink.
generate_to_writer_default
Stream the default generated output into any std::io::Write sink.
generate_with_options
Generate Rust source code with custom codegen options.