Skip to main content

redact_string

Function redact_string 

Source
pub fn redact_string(value: &str, policy: &RedactionPolicy) -> String
Expand description

Apply redaction rules to a string value based on the given policy’s output level.

  • None: returns the string unchanged.
  • Baseline: wholesale-masks if the string matches any sensitive value prefix; otherwise applies entity detection and masks individual PII spans ([REDACTED:<category>]) while preserving surrounding context.
  • Full: returns "[REDACTED]".