#thrift #grpc #protobuf #volo #build

volo-build

Compile thrift and protobuf idls into rust code at compile-time

12 unstable releases (3 breaking)

0.4.2 Apr 24, 2023
0.4.1 Mar 17, 2023
0.3.4 Mar 7, 2023
0.3.3 Feb 21, 2023
0.1.0 Aug 23, 2022

#341 in Network programming

Download history 7/week @ 2023-01-20 19/week @ 2023-01-27 76/week @ 2023-02-03 45/week @ 2023-02-10 66/week @ 2023-02-17 31/week @ 2023-02-24 46/week @ 2023-03-03 83/week @ 2023-03-10 132/week @ 2023-03-17 40/week @ 2023-03-24 56/week @ 2023-03-31 64/week @ 2023-04-07 26/week @ 2023-04-14 55/week @ 2023-04-21 41/week @ 2023-04-28 60/week @ 2023-05-05

195 downloads per month
Used in volo-cli

MIT/Apache

66KB
1.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

~13–20MB
~361K SLoC