Skip to main content

ReplacementGenerator

Trait ReplacementGenerator 

Source
pub trait ReplacementGenerator: Send + Sync {
    // Required method
    fn generate(&self, category: &Category, original: &str) -> String;
}
Expand description

Strategy for generating a sanitized replacement value.

Implementations MUST be deterministic to their inputs: given the same (category, original) pair (and same internal state / seed), the output must be identical. This is what enables per-run consistency when backed by a MappingStore that calls generate only once per unique value.

Required Methods§

Source

fn generate(&self, category: &Category, original: &str) -> String

Produce a sanitized replacement for original classified as category.

Implementors§