Struct regex_test::CompiledRegex
source · pub struct CompiledRegex { /* private fields */ }
Expand description
The result of compiling a regex.
In many implementations, the act of matching a regex can be separated from
the act of compiling a regex. A CompiledRegex
represents a regex that has
been compiled and is ready to be used for matching.
The matching implementation is represented by a closure that accepts a
&RegexTest
and returns a TestResult
.
Implementations§
source§impl CompiledRegex
impl CompiledRegex
sourcepub fn compiled(
matcher: impl FnMut(&RegexTest) -> TestResult + 'static
) -> CompiledRegex
pub fn compiled( matcher: impl FnMut(&RegexTest) -> TestResult + 'static ) -> CompiledRegex
Provide a closure that represents the compiled regex and executes a
regex match on any RegexTest
. The RegexTest
given to the closure
provided is the exact same RegexTest
that is used to compile this
regex.
sourcepub fn skip() -> CompiledRegex
pub fn skip() -> CompiledRegex
Indicate that tests on this regex should be skipped. This typically
occurs if the RegexTest
requires something that an implementation
does not support.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for CompiledRegex
impl !Send for CompiledRegex
impl !Sync for CompiledRegex
impl Unpin for CompiledRegex
impl !UnwindSafe for CompiledRegex
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