Struct safe_regex::Matcher [−][src]
A compiled regular expression.
This is a zero-length type.
The regex!
macro generates a Rust type that implements the regular expression.
This Matcher
is just a holder for that type.
Implementations
impl<S, T> Matcher<T> where
S: AsRef<[Range<u32>]> + Debug,
T: Machine<GroupRanges = S> + Eq + Hash + Debug + Sized,
[src]
S: AsRef<[Range<u32>]> + Debug,
T: Machine<GroupRanges = S> + Eq + Hash + Debug + Sized,
pub fn match_all<'d>(
&self,
data: &'d [u8]
) -> Option<Groups<'d, T::GroupRanges>>
[src]
&self,
data: &'d [u8]
) -> Option<Groups<'d, T::GroupRanges>>
Executes the regular expression against the byte string data
.
Returns Some
if the expresison matched all of the bytes in data
.
This is not a sub-string search.
If you need a sub-string search,
put .*
at the beginning and end of the regex.
Returns None
if the expression did not match data
.
pub fn new() -> Self
[src]
This is used internally by the regex!
macro.
We can make this function const
when
trait bounds on `const fn` parameters are stable.
Auto Trait Implementations
impl<T> RefUnwindSafe for Matcher<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for Matcher<T> where
T: Send,
T: Send,
impl<T> Sync for Matcher<T> where
T: Sync,
T: Sync,
impl<T> Unpin for Matcher<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for Matcher<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,