pub trait DebugRedacted {
// Required methods
fn fmt_redacted(&self, f: &mut Formatter<'_>) -> Result;
fn fmt_unredacted(&self, f: &mut Formatter<'_>) -> Result;
}
Expand description
A type that can be debugged in a redacted or un-redacted form, but which forces the caller to choose.
See Redactable
for more discussion on redaction.
Unlike Redactable
, this type is “inherently sensitive”:
Debug
will display it in redacted or un-redacted format
depending on whether safe logging is enabled.
For external types that implement Debug
,
or for types which are usually not sensitive,
Redacted
is likely a better choice.
Required Methods§
Sourcefn fmt_redacted(&self, f: &mut Formatter<'_>) -> Result
fn fmt_redacted(&self, f: &mut Formatter<'_>) -> Result
As Debug::fmt
, but write this object
in its redacted form.
Sourcefn fmt_unredacted(&self, f: &mut Formatter<'_>) -> Result
fn fmt_unredacted(&self, f: &mut Formatter<'_>) -> Result
As Debug::fmt
, but write this object
in its unredacted form.