#[non_exhaustive]pub enum Category {
Show 19 variants
Email,
Name,
Phone,
CreditCard,
Ssn,
IpV4,
IpV6,
MacAddress,
Hostname,
ContainerId,
Uuid,
Jwt,
AuthToken,
FilePath,
WindowsSid,
Url,
AwsArn,
AzureResourceId,
Custom(CompactString),
}Expand description
Classification of a sensitive data value. Determines the replacement format.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Email addresses → preserve domain, hex username
Name
Person names → synthetic name from hash-indexed table
Phone
Phone numbers → format-preserving numeric replacement
CreditCard
Credit card numbers → format-preserving numeric replacement (fails Luhn)
Ssn
Social Security Numbers → 000-<hash>-formatted replacement
IpV4
IPv4 addresses → preserve dots, replace digit groups
IpV6
IPv6 addresses → preserve colons/::, replace hex digits
MacAddress
MAC addresses → preserve : or - separators, replace hex digits
Hostname
Hostname / FQDN → preserve domain suffix, hex prefix
ContainerId
Docker / container hex IDs → replace hex digits
Uuid
UUIDs → preserve - dashes, replace hex digits
Jwt
JSON Web Tokens → preserve . separators, replace base64url chars
AuthToken
Opaque auth tokens / API keys / bearer tokens
FilePath
File paths → preserve /, \, and extension; replace segment content
WindowsSid
Windows Security Identifiers → preserve S- prefix and - separators
Url
URLs → preserve scheme and structural chars (://, /, ?, =, &)
AwsArn
AWS ARNs → preserve : and / separators, replace content segments
AzureResourceId
Azure Resource IDs → preserve / structure and well-known segment names
Custom(CompactString)
Arbitrary / user-defined category
Implementations§
Source§impl Category
impl Category
Sourcepub fn domain_tag(&self) -> &str
pub fn domain_tag(&self) -> &str
Return a stable string key used for HMAC domain separation.
Equivalent to as_str() for backward compatibility.
For HMAC domain separation use domain_tag_hmac()
which prefixes custom categories to prevent collisions.
Sourcepub fn domain_tag_hmac(&self) -> String
pub fn domain_tag_hmac(&self) -> String
Return a collision-safe string key for HMAC domain separation.
For Custom categories, this includes the custom: prefix to
prevent collisions with built-in category tags (e.g. a
Custom("email") won’t collide with the built-in Email tag).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Category
impl<'de> Deserialize<'de> for Category
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
impl Eq for Category
impl StructuralPartialEq for Category
Auto Trait Implementations§
impl Freeze for Category
impl RefUnwindSafe for Category
impl Send for Category
impl Sync for Category
impl Unpin for Category
impl UnsafeUnpin for Category
impl UnwindSafe for Category
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read more