pajamax-build

Crates.iopajamax-build
lib.rspajamax-build
version0.3.0
created_at2025-05-16 01:42:22.109085+00
updated_at2025-07-18 08:13:39.828213+00
descriptionCodegen module of `pajamax` gRPC implementation.
homepage
repositoryhttps://github.com/WuBingzheng/pajamax-build
max_upload_size
id1675872
size29,348
(WuBingzheng)

documentation

https://docs.rs/pajamax-build

README

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.

  1. Import pajamax and pajamax-build in your Cargo.toml:

    [dependencies]
    pajamax = "0.2"
    prost = "0.1"
    
    [build-dependencies]
    pajamax-build = "0.2"
    
  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"], &["."])
    }
    
  3. Call pajamax in your source code. See the helloworld and other examples for details.

License: MIT

Commit count: 0

cargo fmt