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 copy 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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)