pub struct LazyPattern { /* private fields */ }Expand description
Wrapper for the regex and the raw pattern string.
The regex will be compiled only when it used once, and the compiled version will be reused on consecutive calls.
Implementations§
Source§impl LazyPattern
 
impl LazyPattern
Sourcepub fn new<S>(raw: S) -> Self
 
pub fn new<S>(raw: S) -> Self
Create a new LazyPattern from a raw string.
Sourcepub fn case_insensitive(self, value: bool) -> Self
 
pub fn case_insensitive(self, value: bool) -> Self
Change the case sensativity settings for the underlying regex.
It’s possible to set the case sensativity on already compiled LazyPattern, which will
be recompiled (re-built) once it’s used again.
Sourcepub fn compiled(&self) -> Result<&Regex, &PiiConfigError>
 
pub fn compiled(&self) -> Result<&Regex, &PiiConfigError>
Compiles the regex from the internal raw string.
Trait Implementations§
Source§impl Clone for LazyPattern
 
impl Clone for LazyPattern
Source§fn clone(&self) -> LazyPattern
 
fn clone(&self) -> LazyPattern
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
 
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from 
source. Read moreSource§impl Debug for LazyPattern
 
impl Debug for LazyPattern
Source§impl<'de> Deserialize<'de> for LazyPattern
 
impl<'de> Deserialize<'de> for LazyPattern
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
 
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<&'static str> for LazyPattern
 
impl From<&'static str> for LazyPattern
Source§fn from(pattern: &'static str) -> LazyPattern
 
fn from(pattern: &'static str) -> LazyPattern
Converts to this type from the input type.
Source§impl PartialEq for LazyPattern
 
impl PartialEq for LazyPattern
Auto Trait Implementations§
impl !Freeze for LazyPattern
impl RefUnwindSafe for LazyPattern
impl Send for LazyPattern
impl Sync for LazyPattern
impl Unpin for LazyPattern
impl UnwindSafe for LazyPattern
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