pub struct RegexCacher { /* private fields */ }Implementations§
Source§impl RegexCacher
impl RegexCacher
Sourcepub fn new(r: Regex) -> RegexCacher
pub fn new(r: Regex) -> RegexCacher
Wrap a Regex with a fast-path cache that checks if a given known input is already known.
This is faster than whatever caching Regex does internally because of string interning.
Sourcepub fn is_match_interned(
&self,
i: u32,
string_cache_inv: &Vec<Rc<String>>,
) -> bool
pub fn is_match_interned( &self, i: u32, string_cache_inv: &Vec<Rc<String>>, ) -> bool
Does the regex match the string based on its interned ID? See also: Grammar::string_cache_inv
Trait Implementations§
Source§impl Clone for RegexCacher
impl Clone for RegexCacher
Source§fn clone(&self) -> RegexCacher
fn clone(&self) -> RegexCacher
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 moreAuto Trait Implementations§
impl Freeze for RegexCacher
impl !RefUnwindSafe for RegexCacher
impl !Send for RegexCacher
impl !Sync for RegexCacher
impl Unpin for RegexCacher
impl !UnwindSafe for RegexCacher
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