Skip to main content

ToRedactedOutput

Trait ToRedactedOutput 

Source
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§

Source

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§

Source§

impl ToRedactedOutput for RedactedJson

Available on crate feature json only.
Source§

impl ToRedactedOutput for RedactedOutput

Source§

impl<T, P> ToRedactedOutput for SensitiveValue<T, P>

Source§

impl<T> ToRedactedOutput for NotSensitiveDebug<T>
where T: Debug,

Source§

impl<T> ToRedactedOutput for NotSensitiveDisplay<T>
where T: Display,

Source§

impl<T> ToRedactedOutput for NotSensitiveJson<'_, T>
where T: Serialize + ?Sized,

Available on crate feature json only.
Source§

impl<T> ToRedactedOutput for RedactedJsonRef<'_, T>
where T: Redactable + Clone + Serialize,

Available on crate feature json only.
Source§

impl<T> ToRedactedOutput for RedactedOutputRef<'_, T>
where T: Redactable + Clone + Debug,