Skip to main content

flatbuffers_tonic_build/
lib.rs

1use std::path::Path;
2
3pub(crate) mod flatbuffers_self;
4pub(crate) mod flatbuffers_tonic;
5
6/// Currently assumes fbs files are independent.
7pub fn compile_flatbuffers_tonic<P>(fbs_path: &[P]) -> Result<(), Box<dyn std::error::Error>>
8where
9    P: AsRef<Path>,
10{
11    // Compile flatbuffers first
12    flatbuffers_self::compile_flat_buffer_self(fbs_path);
13
14    // Then compile tonic
15    flatbuffers_tonic::compile_flatbuffers_tonic_file_list_only(fbs_path)?;
16    Ok(())
17}