Skip to main content

SensitiveDisplay

Derive Macro SensitiveDisplay 

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

Derives redactable::RedactableDisplay using a display template.

This generates a redacted string representation without requiring Clone. Every field referenced in the template must be explicitly annotated:

  • #[sensitive(Policy)]: Apply the policy’s redaction rules
  • #[not_sensitive]: Render raw (explicit opt-out)

The display template is taken from #[error("...")] (thiserror-style) or from doc comments (displaydoc-style). If neither is present, the derive fails.

Fields are redacted by reference, so field types do not need Clone.