zebra-grpc 0.1.0-alpha.13

Zebra gRPC interface
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//! Compile proto files

use std::{env, path::PathBuf};

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let out_dir = PathBuf::from(env::var("OUT_DIR").unwrap());

    tonic_build::configure()
        .btree_map(["."])
        .protoc_arg("--experimental_allow_proto3_optional")
        .type_attribute(".", "#[derive(serde::Deserialize, serde::Serialize)]")
        .file_descriptor_set_path(out_dir.join("scanner_descriptor.bin"))
        .compile_protos(&["proto/scanner.proto"], &[""])?;

    Ok(())
}