#[non_exhaustive]pub enum FieldClassification<'a> {
Sensitive {
rule: SensitiveFieldRule<'a>,
match_kind: FieldMatchKind,
},
Allowed {
rule: AllowRule<'a>,
match_kind: FieldMatchKind,
},
Unknown,
}Expand description
Explains why a field is sensitive, allowed, or unknown to a policy.
Matched rules borrow canonical field names from the immutable policy, so callers can inspect classification without cloning rule metadata.
§Type Parameters
'a- Lifetime of canonical field names borrowed from the policy.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Sensitive
A sensitive rule classified the field.
Fields
rule: SensitiveFieldRule<'a>Borrowed configured rule that supplied the sensitivity.
match_kind: FieldMatchKindThe canonical input candidate that matched this rule.
Allowed
An allow rule took precedence over sensitivity at the same candidate.
Fields
match_kind: FieldMatchKindThe canonical input candidate that matched this rule.
Unknown
No configured rule classified the field.
Implementations§
Source§impl<'a> FieldClassification<'a>
impl<'a> FieldClassification<'a>
Sourcepub const fn sensitivity(self) -> Option<Sensitivity>
pub const fn sensitivity(self) -> Option<Sensitivity>
Returns the configured sensitivity when the field is sensitive.
§Returns
Some(level) for Self::Sensitive, or None for allowed and unknown
fields.
Sourcepub const fn matched_field(self) -> Option<&'a str>
pub const fn matched_field(self) -> Option<&'a str>
Returns the canonical configured field that matched.
§Returns
A field name borrowed from the policy for sensitive and allowed
classifications, or None for Self::Unknown.
Sourcepub const fn match_kind(self) -> Option<FieldMatchKind>
pub const fn match_kind(self) -> Option<FieldMatchKind>
Returns the canonical input candidate that matched the configured rule.
§Returns
The exact input or a semantic token suffix for sensitive and allowed
classifications, or None for Self::Unknown.
Sourcepub const fn is_allowed(self) -> bool
pub const fn is_allowed(self) -> bool
Sourcepub const fn is_unknown(self) -> bool
pub const fn is_unknown(self) -> bool
Trait Implementations§
Source§impl<'a> Clone for FieldClassification<'a>
impl<'a> Clone for FieldClassification<'a>
Source§fn clone(&self) -> FieldClassification<'a>
fn clone(&self) -> FieldClassification<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more