36 releases

new 0.10.6 May 15, 2024
0.10.3 Apr 8, 2024
0.9.5 Feb 27, 2024
0.9.1 Dec 25, 2023
0.2.1 Oct 26, 2022

#841 in Encoding

Download history 36/week @ 2024-01-24 41/week @ 2024-01-31 46/week @ 2024-02-07 64/week @ 2024-02-14 226/week @ 2024-02-21 227/week @ 2024-02-28 96/week @ 2024-03-06 93/week @ 2024-03-13 94/week @ 2024-03-20 84/week @ 2024-03-27 578/week @ 2024-04-03 179/week @ 2024-04-10 580/week @ 2024-04-17 247/week @ 2024-04-24 275/week @ 2024-05-01 249/week @ 2024-05-08

1,374 downloads per month
Used in 4 crates (3 directly)

MIT/Apache

260KB
6.5K 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–49MB
~835K SLoC