#[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_hmac(&self) -> Cow<'_, str>
pub fn domain_tag_hmac(&self) -> Cow<'_, str>
Return a collision-safe key for HMAC domain separation.
For Custom categories this includes the custom: prefix so that
Custom("email") cannot collide with the built-in Email tag.
Returns Borrowed for all built-in variants (zero allocation) and
Owned only for Custom (one allocation per HMAC call).
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
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