Skip to main content

qubit_redact/policy/field/
sensitivity.rs

1// =============================================================================
2//    Copyright (c) 2025 - 2026 Haixing Hu.
3//
4//    SPDX-License-Identifier: Apache-2.0
5//
6//    Licensed under the Apache License, Version 2.0.
7// =============================================================================
8//! Sensitivity levels used to select masking behavior.
9
10/// Sensitivity assigned to a field or explicit value.
11///
12/// The strength order is `Low < Medium < High < Secret`.
13///
14/// # Examples
15///
16/// ```
17/// use qubit_redact::Sensitivity;
18///
19/// assert!(Sensitivity::Secret > Sensitivity::High);
20/// ```
21#[non_exhaustive]
22#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
23pub enum Sensitivity {
24    /// Low-risk value where keeping a small prefix and suffix is acceptable.
25    Low,
26    /// Moderately sensitive value where only a small suffix is retained.
27    Medium,
28    /// Highly sensitive value replaced by a fixed mask.
29    High,
30    /// Secret value replaced by the strongest configured mask.
31    Secret,
32}