pub enum Mask {
PerChar(char),
Token(String),
Shape,
Pseudonym(Pseudonyms),
}Expand description
What a redaction writes over the characters it removes.
Variants§
PerChar(char)
One copy of the character for each character removed, so every offset and column after the span survives.
Token(String)
One copy of the token for each masked run, whatever the run’s length.
Shape
Every letter and digit masked and every other byte kept, so the run keeps the shape its kind is recognized by and the redacted copy still lexes as the original did.
Pseudonym(Pseudonyms)
Each distinct value replaced by a stable name per kind, so a value that recurred still recurs and the axes that read recurrence - echo, the joins, the templates - read the redacted copy as they read the original.
Implementations§
Source§impl Mask
impl Mask
Sourcepub fn parse(src: &str) -> Result<Mask, String>
pub fn parse(src: &str) -> Result<Mask, String>
A one-character string masks per character; shape and pseudonym
name the two masks that read the run; any other longer string is the
token each masked run becomes.
§Errors
An empty mask, which would leave the removed characters nothing in their place.