pub struct MaskingEngine { /* private fields */ }Expand description
A compiled set of masking rules.
Implementations§
Source§impl MaskingEngine
impl MaskingEngine
Sourcepub fn with_custom(custom: &[String]) -> Self
pub fn with_custom(custom: &[String]) -> Self
Build an engine from built-in patterns plus custom regex strings.
Sourcepub fn mask(&self, text: &str) -> String
pub fn mask(&self, text: &str) -> String
Apply all masking rules to text, returning the masked version.
Sourcepub fn mask_if_needed(&self, text: &str) -> Option<String>
pub fn mask_if_needed(&self, text: &str) -> Option<String>
Mask only if secrets are present; return None if no change.
Auto Trait Implementations§
impl Freeze for MaskingEngine
impl RefUnwindSafe for MaskingEngine
impl Send for MaskingEngine
impl Sync for MaskingEngine
impl Unpin for MaskingEngine
impl UnsafeUnpin for MaskingEngine
impl UnwindSafe for MaskingEngine
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
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>
Converts
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>
Converts
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 more