pub struct RegexCache { /* private fields */ }Expand description
Cache of compiled regex patterns keyed by the raw pattern string. Prevents re-compilation on every evaluation pass.
Implementations§
Source§impl RegexCache
impl RegexCache
Sourcepub fn get_or_compile(&self, pattern: &str) -> Option<Regex>
pub fn get_or_compile(&self, pattern: &str) -> Option<Regex>
Returns a compiled regex, or None if the pattern is invalid.
Trait Implementations§
Source§impl Clone for RegexCache
impl Clone for RegexCache
Source§fn clone(&self) -> RegexCache
fn clone(&self) -> RegexCache
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for RegexCache
impl Default for RegexCache
Source§fn default() -> RegexCache
fn default() -> RegexCache
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for RegexCache
impl RefUnwindSafe for RegexCache
impl Send for RegexCache
impl Sync for RegexCache
impl Unpin for RegexCache
impl UnsafeUnpin for RegexCache
impl UnwindSafe for RegexCache
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