#debugging #derive #macro #macro-derive #ease #redacted #redacting

macro redacted_debug

A small procedural macro to allow redacting sensitive information without losing the ease of use of deriving Debug

2 unstable releases

0.2.0 Jan 16, 2023
0.1.0 Feb 5, 2019

#51 in #ease

31 downloads per month
Used in pshovr

MIT license

8KB
143 lines

A generic mechanism for redacting things in your Debug impls

There is a small example that shows how to use it, but generally speaking:

use redacted_debug::RedactedDebug;

#[derive(RedactedDebug)]
struct User {
    username: String,
    #[redacted]
    password: String,
    /* ... */
}

This will give you a Debug implementation, but when printed the password field will be "...".

Dependencies

~1.5MB
~33K SLoC