pub trait ToRedactedOutput {
// Required method
fn to_redacted_output(&self) -> RedactedOutput;
}Expand description
Produces a logging-safe output representation.
This trait is intentionally narrower than RedactableWithFormatter.
Passthrough scalar formatting is useful inside redacted templates, but it
does not certify a raw value as safe at a logging boundary.
Required Methods§
Sourcefn to_redacted_output(&self) -> RedactedOutput
fn to_redacted_output(&self) -> RedactedOutput
Produces an owned, logging-safe representation of this value.
The implementing type certifies that the returned RedactedOutput
contains no sensitive data: either redaction has already been applied
or the value was never sensitive. Logging integrations call this
method at the logging boundary; prefer it over formatting the raw
value with Display or Debug.
The method borrows self and returns an owned output value, leaving
the original in place. Implementations may clone or otherwise
traverse self to build the output and inherit the panics of doing
so; see the documentation of the concrete implementing type for its
panic behavior.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl ToRedactedOutput for RedactedJson
json only.impl ToRedactedOutput for RedactedOutput
impl<T, P> ToRedactedOutput for SensitiveValue<T, P>where
T: SensitiveWithPolicy<P>,
P: RedactionPolicy,
impl<T> ToRedactedOutput for NotSensitiveDebug<T>where
T: Debug,
impl<T> ToRedactedOutput for NotSensitiveDisplay<T>where
T: Display,
impl<T> ToRedactedOutput for NotSensitiveJson<'_, T>
json only.impl<T> ToRedactedOutput for RedactedJsonRef<'_, T>
json only.