#[non_exhaustive]pub enum Action {
Tokenize,
Redact,
FormatPreserve,
Generalize,
Preserve,
}Expand description
Disposition applied to a detected PII span.
| Variant | Restorable | Output shape |
|---|---|---|
Tokenize | Yes | Opaque token: <hex:Class_N> |
FormatPreserve | Yes | Realistic-looking pseudonym (e.g., email1.hex@gaze-fake.invalid) |
Redact | No | Literal [REDACTED] – original value is gone |
Generalize | No | Class label (e.g., [Email]) – original value is gone |
Preserve | - | Passes through unchanged |
Action is #[non_exhaustive]. Use a wildcard arm in exhaustive matches.
When restore is required, use Tokenize or FormatPreserve – Redact and
Generalize are irreversible.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Tokenize
Replace PII with a reversible token.
Redact
Replace PII with a non-restorable redaction marker.
FormatPreserve
Replace PII with a reversible format-preserving token.
Generalize
Replace PII with a broader category.
Preserve
Preserve the original value.
Trait Implementations§
impl Copy for Action
impl Eq for Action
impl StructuralPartialEq for Action
Auto Trait Implementations§
impl Freeze for Action
impl RefUnwindSafe for Action
impl Send for Action
impl Sync for Action
impl Unpin for Action
impl UnsafeUnpin for Action
impl UnwindSafe for Action
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more