ProstUuid new-type wrapper around uuid::Uuid with prost::Message implemented for it.
Create a protobuf file for uuid (will be provided out-of-the-box in future release):
```proto syntax = "proto3"; package uuid;
message Uuid { string uuid_str = 1; } ```
and use it in your own protobuf:
proto
message User {
uuid.Uuid id = 1;
string email = 2;
}
in Rust code you will be able to use ProstUuid
interchangably with uuid::Uuid
via different methods and dereferencing:
```rust fn testderivemore() { let prostuuid = ProstUuid::from(Uuid::nil()); let uuid = Uuid::from(prostuuid); asserteq!(format!("{}", uuid), format!("{}", prostuuid)); let newprostuuid = ProstUuid::new(uuid); let mut mutprostuuid = newprostuuid; let anotherprostuuid = newprostuuid; functionexpectuuid( newprostuuid.asref(), mutprostuuid.asmut(), *anotherprostuuid, ); }
fn function_expect_uuid(_uuid_ref: &Uuid, _uuid_mut_ref: &mut Uuid, _uuid: Uuid) {}
```