| Crates.io | pajamax-build |
| lib.rs | pajamax-build |
| version | 0.3.0 |
| created_at | 2025-05-16 01:42:22.109085+00 |
| updated_at | 2025-07-18 08:13:39.828213+00 |
| description | Codegen module of `pajamax` gRPC implementation. |
| homepage | |
| repository | https://github.com/WuBingzheng/pajamax-build |
| max_upload_size | |
| id | 1675872 |
| size | 29,348 |
pajamax-build compiles .proto files via prost and generates service
stubs and proto definitions for use with pajamax.
The usage is very similar to that of Tonic.
Import pajamax and pajamax-build in your Cargo.toml:
[dependencies]
pajamax = "0.2"
prost = "0.1"
[build-dependencies]
pajamax-build = "0.2"
Call pajamax-build in build.rs:
fn main() -> Result<(), Box<dyn std::error::Error>> {
pajamax_build::compile_protos_local(&["proto/helloworld.proto"], &["."])?;
Ok(())
}
If your want more options, call prost_build directly with PajamaxGen:
fn main() -> Result<(), Box<dyn std::error::Error>> {
prost_build::Config::new()
// add your options here
.service_generator(Box::new(pajamax_build::PajamaxGen{ mode: Mode::Local }))
.compile_protos(&["proto/helloworld.proto"], &["."])
}
Call pajamax in your source code. See the
helloworld
and other examples
for details.
License: MIT