Skip to content

Commit

Permalink
feat(build): Add simple api to compile file descriptor set (#1921)
Browse files Browse the repository at this point in the history
  • Loading branch information
tottoto authored Sep 4, 2024
1 parent e4c71b8 commit 77b8223
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion tonic-build/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ use quote::TokenStreamExt;
mod prost;

#[cfg(feature = "prost")]
pub use prost::{compile_protos, configure, Builder};
pub use prost::{compile_fds, compile_protos, configure, Builder};

pub mod manual;

Expand Down
5 changes: 5 additions & 0 deletions tonic-build/src/prost.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ pub fn compile_protos(proto: impl AsRef<Path>) -> io::Result<()> {
self::configure().compile_protos(&[proto_path], &[proto_dir])
}

/// Simple file descriptor set compiling. Use [`configure`] instead if you need more options.
pub fn compile_fds(fds: prost_types::FileDescriptorSet) -> io::Result<()> {
self::configure().compile_fds(fds)
}

/// Non-path Rust types allowed for request/response types.
const NON_PATH_TYPE_ALLOWLIST: &[&str] = &["()"];

Expand Down

0 comments on commit 77b8223

Please sign in to comment.