Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. use prost_build::Config;
  2.  
  3. fn main() {
  4. // Create prost-build configuration
  5. let mut prost_config = Config::new();
  6.  
  7. // Add desired type attribute
  8. prost_config.type_attribute("HelloReply", "#[derive(Serialize)]");
  9.  
  10. // Create tower-grpc-build configuration from prost-build configuration
  11. tower_grpc_build::Config::from_prost(prost_config)
  12. .enable_server(true)
  13. .enable_client(true)
  14. .build(
  15. &["proto/helloworld/helloworld.proto"],
  16. &["proto/helloworld"],
  17. )
  18. .unwrap_or_else(|e| panic!("protobuf compilation failed: {}", e));
  19. // --snip--
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement