#[derive(NotSensitiveDisplay)]
{
// Attributes available to this derive:
#[not_sensitive_display]
}
Expand description
Derives redactable::RedactableDisplay for types with no sensitive data.
This is the display counterpart to NotSensitive. Use it when you have a type
with no sensitive data that needs logging integration (e.g., for use with slog).
Unlike SensitiveDisplay, this derive does not require a display template.
Instead, it delegates directly to the type’s existing Display implementation.
§Container Attributes
#[not_sensitive_display(skip_debug)]- Opt out ofDebugimpl generation. Use this when you need a customDebugimplementation or the type already derivesDebugelsewhere.
§Required Bounds
The type must implement Display. This is required because RedactableDisplay delegates
to Display::fmt.
§Generated Impls
RedactableDisplay: delegates toDisplay::fmtDebug: when not building withcfg(any(test, feature = "testing")),Debugformats viaDisplay::fmt. In test/testing builds, it uses standardDebugformatting (requires the type to also implementDebugfor test builds).slog::Value(behindcfg(feature = "slog")): usesRedactableDisplayoutputSlogRedacted(behindcfg(feature = "slog")): marker traitTracingRedacted(behindcfg(feature = "tracing")): marker trait
§Example
ⓘ
use redactable::NotSensitiveDisplay;
#[derive(Clone, NotSensitiveDisplay)]
#[display(fmt = "RetryDecision")] // Or use displaydoc/thiserror for Display impl
enum RetryDecision {
Retry,
Abort,
}