Open
Description
Hi! 👋
Over in uuid-rs/uuid#583 we've been talking about adding unstable valuable
support to Uuid
and run into a bit of a design issue I wanted to get some input on.
It looks like we've got two possible directions we can go in:
- Treat
Uuid
as its text-based format and useValue::Displayable
(dyn Display
primitive value #86). This means end-users in the diagnostics use-case will see something resembling a UUID rather than a blob of bytes without needing to match on strings (assumingtracing
will eventually run all values throughvaluable
), but it means reconstructing aUuid
from thatdyn Display
will require more work. - Treat
Uuid
as its raw byte format and useValue::Listable
. This is less work than 1, and a more accurate representation of the UUIDs internal structure, but if we want a text-based UUID we need to look at its stringly-typed name and parse it.
This seems like a general question that authors of primitive value types like UUIDs and IP addresses are going to need to answer, so was looking for some input on what you all think is the direction that best aligns with the goals of the valuable
project.
Metadata
Metadata
Assignees
Labels
No labels