29 releases (7 breaking)

0.9.5 Feb 27, 2024
0.9.3 Jan 12, 2024
0.9.1 Dec 25, 2023
0.8.5 Nov 27, 2023
0.2.1 Oct 26, 2022

#461 in Encoding

Download history 75/week @ 2023-12-04 55/week @ 2023-12-11 79/week @ 2023-12-18 74/week @ 2023-12-25 62/week @ 2024-01-01 102/week @ 2024-01-08 69/week @ 2024-01-15 44/week @ 2024-01-22 25/week @ 2024-01-29 55/week @ 2024-02-05 55/week @ 2024-02-12 55/week @ 2024-02-19 392/week @ 2024-02-26 88/week @ 2024-03-04 105/week @ 2024-03-11 94/week @ 2024-03-18

680 downloads per month
Used in 4 crates (3 directly)

MIT/Apache

215KB
5.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

~34–50MB
~839K SLoC