pub struct PatternDetector { /* private fields */ }Expand description
The built-in detector: patterns with check-digit validation where the
format has one, so a random 16-digit order number is not a card and
2024-01-15 is not a phone.
Implementations§
Source§impl PatternDetector
impl PatternDetector
Sourcepub fn new(opts: &RedactionOptions) -> Result<Self, RedactionError>
pub fn new(opts: &RedactionOptions) -> Result<Self, RedactionError>
Build from the options: the pattern kinds in scope, the custom patterns compiled (an invalid one is the error), the deny terms as whole-word case-insensitive matches.
Trait Implementations§
Source§impl PiiDetector for PatternDetector
impl PiiDetector for PatternDetector
Auto Trait Implementations§
impl Forget for PatternDetector
impl Freeze for PatternDetectorwhere
*const u8 is !null: Freeze,
PhantomData<PiiKind>: Freeze,
PhantomData<(String, Regex)>: Freeze,
PhantomData<Regex>: Freeze,
PhantomData<String>: Freeze,
impl Move for PatternDetector
impl RefUnwindSafe for PatternDetectorwhere
Atomic<usize>: RefUnwindSafe,
Pool<Cache, Box<dyn Fn() -> Cache + Sync + Send + UnwindSafe + RefUnwindSafe>>: RefUnwindSafe,
impl Send for PatternDetector
impl Sync for PatternDetector
impl Unpin for PatternDetector
impl UnsafeUnpin for PatternDetectorwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<PiiKind>: UnsafeUnpin,
PhantomData<(String, Regex)>: UnsafeUnpin,
PhantomData<Regex>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
impl UnwindSafe for PatternDetectorwhere
RawVecInner: UnwindSafe,
Arc<RegexI>: UnwindSafe,
BoxRaw<Pool<Cache, Box<dyn Fn() -> Cache + Sync + Send + UnwindSafe + RefUnwindSafe>>>: UnwindSafe,
Arc<str>: UnwindSafe,
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