48 releases

0.10.18 Nov 29, 2024
0.10.15 Sep 18, 2024
0.10.12 Jul 29, 2024
0.9.5 Feb 27, 2024
0.2.1 Oct 26, 2022

#1402 in Procedural macros

Download history 156/week @ 2024-10-25 349/week @ 2024-11-01 151/week @ 2024-11-08 82/week @ 2024-11-15 57/week @ 2024-11-22 265/week @ 2024-11-29 163/week @ 2024-12-06 208/week @ 2024-12-13 94/week @ 2024-12-20 44/week @ 2024-12-27 114/week @ 2025-01-03 168/week @ 2025-01-10 144/week @ 2025-01-17 79/week @ 2025-01-24 97/week @ 2025-01-31 138/week @ 2025-02-07

502 downloads per month
Used in 3 crates (2 directly)

MIT/Apache

275KB
7K SLoC

Volo

volo-build compiles thrift and protobuf idl files into rust code at compile-time.

Example

Usually, if you are using volo-cli to generate the code, you don't need to use volo-build directly.

If you want to use volo-build directly, you can follow the following steps:

First, add volo-build to your Cargo.toml:

[build-dependencies]
volo-build = "*" # make sure you use a compatible version with `volo`

Second, creates a build.rs file:

fn main() {
    volo_build::Builder::default().write().unwrap();
}

Third, creates a volo.yml file in the same directory of build.rs with the following layout:

---
idls:
  - source: local
    path: path/to/your/idl.thrift
  - source: local
    path: path/to/your/protobuf/idl.proto
    includes:
    - path/to/your/protobuf/
  - source: git
    repo: git@github.com:cloudwego/volo.git
    ref: main
    path: path/in/repo/idl.thrift

That's it!

Dependencies

~35–53MB
~840K SLoC