pub struct RedactionRules { /* private fields */ }Expand description
Immutable, cheap-to-clone field classification snapshot.
§Examples
use qubit_redact::RedactionPolicy;
use qubit_redact::Sensitivity;
let policy = RedactionPolicy::standard();
let rules = policy.rules();
assert_eq!(rules.sensitivity_for("password"), Some(Sensitivity::Secret));Implementations§
Source§impl RedactionRules
impl RedactionRules
Sourcepub fn floor(&self) -> Option<&RedactionFloor>
pub fn floor(&self) -> Option<&RedactionFloor>
Returns the attached minimum floor, if enabled.
Sourcepub fn sensitivity_for(&self, field: &str) -> Option<Sensitivity>
pub fn sensitivity_for(&self, field: &str) -> Option<Sensitivity>
Resolves final sensitivity from application and floor layers.
Sourcepub fn matching(&self) -> FieldNameMatching
pub fn matching(&self) -> FieldNameMatching
Returns the application layer’s field-name matching mode.
Sourcepub fn unknown_field_policy(&self) -> UnknownFieldPolicy
pub fn unknown_field_policy(&self) -> UnknownFieldPolicy
Returns the application fallback for unclassified fields.
Sourcepub fn application_sensitive_rules(
&self,
) -> impl Iterator<Item = SensitiveFieldRule<'_>>
pub fn application_sensitive_rules( &self, ) -> impl Iterator<Item = SensitiveFieldRule<'_>>
Iterates only application sensitive rules, never floor rules.
Sourcepub fn application_allow_rules(&self) -> impl Iterator<Item = AllowRule<'_>>
pub fn application_allow_rules(&self) -> impl Iterator<Item = AllowRule<'_>>
Iterates only application allow rules, never floor rules.
Sourcepub fn with_floor(self, floor: RedactionFloor) -> Self
pub fn with_floor(self, floor: RedactionFloor) -> Self
Replaces the floor for this rules snapshot.
Sourcepub fn add_floor(self, floor: RedactionFloor) -> Self
pub fn add_floor(self, floor: RedactionFloor) -> Self
Adds a floor without weakening an existing floor.
Sourcepub fn disable_floor(self) -> Self
pub fn disable_floor(self) -> Self
Disables all floor protection for this rules snapshot.
§Security
This explicitly removes global and configured minimum protection. Use it only when the caller intentionally accepts responsibility for doing so.
Sourcepub fn classify_field<'a>(&'a self, field: &str) -> FieldClassification<'a>
pub fn classify_field<'a>(&'a self, field: &str) -> FieldClassification<'a>
Explains application-rule matching only; it is not the final safety decision.
Trait Implementations§
Source§impl Clone for RedactionRules
impl Clone for RedactionRules
Source§fn clone(&self) -> RedactionRules
fn clone(&self) -> RedactionRules
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more