2 unstable releases
new 0.2.0 | May 23, 2025 |
---|---|
0.1.0 | May 16, 2025 |
#17 in #blocking
143 downloads per month
8KB
92 lines
pajamax-build
pajamax-build
compiles .proto files via prost
and generates service
stubs and proto definitions for use with pajamax
.
Usage
The usage is very similar to that of Tonic.
-
Import
pajamax
andpajamax-build
in your Cargo.toml:[dependencies] pajamax = "0.1" prost = "0.1" [build-dependencies] pajamax-build = "0.1"
-
Call
pajamax-build
in build.rs:fn main() -> Result<(), Box<dyn std::error::Error>> { pajamax_build::compile_protos(&["proto/helloworld.proto"], &["."])?; Ok(()) }
If your want more options, call
prost_build
directly withPajamaxGen
:fn main() -> Result<(), Box<dyn std::error::Error>> { prost_build::Config::new() // add your options here .service_generator(Box::new(pajamax_build::PajamaxGen())) .compile_protos(&["proto/helloworld.proto"], &["."]) }
-
Call
pajamax
in your source code. See thehelloworld
for more details.
Dependencies
~8–18MB
~251K SLoC