Skip to main content

SensitiveDual

Derive Macro SensitiveDual 

Source
#[derive(SensitiveDual)]
{
    // Attributes available to this derive:
    #[sensitive]
    #[not_sensitive]
    #[redactable]
    #[error]
}
Expand description

Derives structural redaction and redacted template text for the same type.

Use this instead of combining Sensitive and SensitiveDisplay with the legacy #[sensitive(dual)] coordination attribute. Every structural field is checked, including fields omitted from the template. Its single ToRedacted impl carries both representations: the template text and the redacted JSON. It therefore requires Clone and serde::Serialize as well as a template.