Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Message for uuid::Uuid #637

Closed
wants to merge 2 commits into from
Closed

Implement Message for uuid::Uuid #637

wants to merge 2 commits into from

Conversation

axyiee
Copy link

@axyiee axyiee commented Apr 28, 2022

Pull Request Information

Title is self-explanatory.

@neoeinstein
Copy link
Contributor

We generally have not elected to take optional implementations like this into Prost. This is in part because the implementation you propose here, while one way to do it, is not necessarily the one cannonical form that we should bless. (The Protobuf specification does not describe a canonical way to encode/decode a UUID.) Some users out there are likely encoding UUIDs as strings, while others are encoding them, as you have, by using bytes.

In this case, this implementation is likely better left to a newtype wrapper that does what you are looking for, rather than being an integral part of either uuid or prost.

@LucioFranco
Copy link
Member

Right the correct solution is for either uuid to provide the Message impl (like it does for serde) or for you to do a newtype warpper and implement it yourself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Example of docs for extern_path doesn't compile
3 participants