Struct safe_regex::Matcher[][src]

pub struct Matcher<T> { /* fields omitted */ }

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]

pub fn match_all<'d>(
    &self,
    data: &'d [u8]
) -> Option<Groups<'d, T::GroupRanges>>
[src]

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

impl<T> Send for Matcher<T> where
    T: Send

impl<T> Sync for Matcher<T> where
    T: Sync

impl<T> Unpin for Matcher<T> where
    T: Unpin

impl<T> UnwindSafe for Matcher<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.