Overriding default Debug implementation for a crate

I'd like to override the "Debug" implementation for "Uuid". I want it to display a censored version in logs when dumping structures that contain UUIDs: CENSORED-35ad-49bb-b118-8e8fc24abf80

Somebody asked this back in 2017. It wasn't possible back then. Any progress?

Insofar as I'm aware, you can't. At least, not with any language features of Rust.

Maybe there's something you can do with a custom linker script, but that'd likely be platform-dependent and incredibly brittle.

That's what I thought. I can encapsulate Uuid in my own type, though, to get control over Debug. Minor pain, but will work.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.