Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use prost_build::Config;
- fn main() {
- // Create prost-build configuration
- let mut prost_config = Config::new();
- // Add desired type attribute
- prost_config.type_attribute("HelloReply", "#[derive(Serialize)]");
- // Create tower-grpc-build configuration from prost-build configuration
- tower_grpc_build::Config::from_prost(prost_config)
- .enable_server(true)
- .enable_client(true)
- .build(
- &["proto/helloworld/helloworld.proto"],
- &["proto/helloworld"],
- )
- .unwrap_or_else(|e| panic!("protobuf compilation failed: {}", e));
- // --snip--
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement