Skip to main content

Crate oxiproto_build

Crate oxiproto_build 

Source
Expand description

oxiproto-build — Pure Rust .proto → Rust codegen, no protoc required.

Downstream crates add this as a [build-dependencies] entry and call compile_protos (or Builder) from their build.rs.

§Quick start

fn main() -> Result<(), Box<dyn std::error::Error>> {
    oxiproto_build::compile_protos(&["proto/service.proto"], &["proto/"])?;
    Ok(())
}

Re-exports§

pub use builder::Builder;
pub use compile_str::compile_str as compile_str_fn;
pub use error::BuildError;
pub use compile_str::compile_str;

Modules§

builder
Builder — configurable .proto → Rust codegen pipeline.
compile_str
Compile an inline proto definition string to a prost_types::FileDescriptorSet.
error
Structured error type for oxiproto-build operations.
parser
Native .proto parser (Slice P fills this in). Native .proto file lexer, outline parser, and full body parser.

Functions§

compile_files_native
Compile a set of .proto files to a prost_types::FileDescriptorSet using the native parser.
compile_protos
Compile .proto files to Rust without requiring protoc on PATH.
compile_str_native
Compile a proto3 source string to a prost_types::FileDescriptorSet using the native pure-Rust parser (no protox dependency).
compile_to_fds
Parse .proto files to a prost_types::FileDescriptorSet without invoking protoc or writing any files.