1 use uuid::DoSomething; 2 mod pb { 3 tonic::include_proto!("my_application"); 4 } main()5fn main() { 6 // verify that extern_path to replace proto's with impl's from other crates works. 7 let message = pb::MyMessage { 8 message_id: Some(::uuid::Uuid { 9 uuid_str: "".to_string(), 10 }), 11 some_payload: "".to_string(), 12 }; 13 dbg!(message.message_id.unwrap().do_it()); 14 } 15 #[cfg(test)] 16 #[test] service_types_have_extern_types()17fn service_types_have_extern_types() { 18 // verify that extern_path to replace proto's with impl's from other crates works. 19 let message = pb::MyMessage { 20 message_id: Some(::uuid::Uuid { 21 uuid_str: "not really a uuid".to_string(), 22 }), 23 some_payload: "payload".to_string(), 24 }; 25 assert_eq!(message.message_id.unwrap().do_it(), "Done"); 26 } 27