Struct regex_cache::CachedRegex
[−]
[src]
pub struct CachedRegex { /* fields omitted */ }
Methods
impl CachedRegex
[src]
pub fn new(
cache: Arc<Mutex<RegexCache>>,
source: &str
) -> Result<CachedRegex, Error>
[src]
cache: Arc<Mutex<RegexCache>>,
source: &str
) -> Result<CachedRegex, Error>
Create a new cached Regex
for the given source, checking the syntax is
valid.
pub fn is_match(&self, text: &str) -> bool
[src]
Refer to Regex::is_match
.
pub fn find<'t>(&self, text: &'t str) -> Option<Match<'t>>
[src]
Refer to Regex::find
.
pub fn captures<'t>(&self, text: &'t str) -> Option<Captures<'t>>
[src]
Refer to Regex::captures
.
pub fn replace<'t, R: Replacer>(&self, text: &'t str, rep: R) -> Cow<'t, str>
[src]
Refer to Regex::replace
.
pub fn replace_all<'t, R: Replacer>(
&self,
text: &'t str,
rep: R
) -> Cow<'t, str>
[src]
&self,
text: &'t str,
rep: R
) -> Cow<'t, str>
Refer to Regex::replace_all
.
pub fn shortest_match(&self, text: &str) -> Option<usize>
[src]
Refer to Regex::shortest_match
.
pub fn captures_len(&self) -> usize
[src]
pub fn as_str(&self) -> &str
[src]
Trait Implementations
impl Clone for CachedRegex
[src]
fn clone(&self) -> CachedRegex
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for CachedRegex
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more