pub enum Strategy {
Tag,
Hash,
Fixed,
Remove,
Truncate(u8),
}Expand description
How matches are replaced in the masked string.
Variants§
Tag
Replace with <TAG> (e.g. <EMAIL>). Default.
Hash
Replace with <TAG:abc12345> where the suffix is blake3 of the
original value, truncated to 8 hex characters. Stable across runs.
Fixed
Replace with █ repeated, preserving the original length.
Remove
Replace with the empty string.
Truncate(u8)
Keep the first prefix characters of the original value, then
append …<TAG>. Useful when the prefix carries debugging signal
(e.g. 4111…<CREDIT_CARD> for the BIN of a card number).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Strategy
impl<'de> Deserialize<'de> for Strategy
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Copy for Strategy
impl Eq for Strategy
impl StructuralPartialEq for Strategy
Auto Trait Implementations§
impl Freeze for Strategy
impl RefUnwindSafe for Strategy
impl Send for Strategy
impl Sync for Strategy
impl Unpin for Strategy
impl UnsafeUnpin for Strategy
impl UnwindSafe for Strategy
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
Mutably borrows from an owned value. Read more