pub enum PiiClass {
Email,
Name,
Location,
Organization,
Custom(String),
}Expand description
The category of a detected PII span.
Built-in variants: Email, Name, Location, Organization. Tenant-specific PII
(case references, titles, internal codes) is carried as PiiClass::Custom(String).
There is no Phone variant – phone detection is provided by recognizers in
gaze-recognizers and surfaces as either a Custom("phone") class or a class
defined by a rulepack.
PiiClass is exhaustive. Match every variant explicitly so new built-in classes
force call sites to review their handling at compile time:
use gaze_types::PiiClass;
fn label(class: &PiiClass) -> &'static str {
match class {
PiiClass::Email => "email",
PiiClass::Name => "name",
PiiClass::Location => "location",
PiiClass::Organization => "org",
PiiClass::Custom(_) => "pii",
}
}Policy TOML uses the lowercase forms email / name / location / organization,
and tenant classes are spelled like custom:case_ref (lowercase, snake_case).
Variants§
Email address class.
Name
Person name class.
Location
Location class.
Organization
Organization class.
Custom(String)
Tenant- or policy-defined class.
Implementations§
Source§impl PiiClass
impl PiiClass
Sourcepub fn from_policy_name(input: &str) -> Option<Self>
pub fn from_policy_name(input: &str) -> Option<Self>
Parses a policy class name into the shared class vocabulary.
Sourcepub fn builtin_variants() -> &'static [PiiClass]
pub fn builtin_variants() -> &'static [PiiClass]
Returns the built-in class variants.
Sourcepub fn as_custom_name(&self) -> Option<&str>
pub fn as_custom_name(&self) -> Option<&str>
Returns the normalized custom class name for custom classes.
Sourcepub fn class_name(&self) -> String
pub fn class_name(&self) -> String
Returns the audit/token display label for this class.