Skip to main content

RedactableWithPolicy

Trait RedactableWithPolicy 

Source
pub trait RedactableWithPolicy<P>: Sized {
    // Required methods
    fn redact_with_policy(self, policy: &TextRedactionPolicy) -> Self;
    fn redacted_string(&self, policy: &TextRedactionPolicy) -> String;
}
Expand description

A policy-aware leaf that can be redacted without requiring a local newtype.

This is the external-type escape hatch: you can implement it for a foreign type using a local policy P, even when you cannot implement RedactableLeaf due to orphan rules.

Required Methods§

Source

fn redact_with_policy(self, policy: &TextRedactionPolicy) -> Self

Returns a redacted version of self using the provided policy.

Source

fn redacted_string(&self, policy: &TextRedactionPolicy) -> String

Returns a redacted string representation using the provided policy.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§