Trait safe_regex::IsMatch

source ·
pub trait IsMatch {
    // Required method
    fn is_match(&self, data: &[u8]) -> bool;

    // Provided methods
    fn assert_match(&self, data: &[u8]) { ... }
    fn assert_no_match(&self, data: &[u8]) { ... }
}
Expand description

Provides an is_match function.

Required Methods§

source

fn is_match(&self, data: &[u8]) -> bool

Returns true if data matches the regular expression, otherwise returns false.

This is a whole-string match. For sub-string search, put .* at the beginning and end of the regex.

Provided Methods§

source

fn assert_match(&self, data: &[u8])

§Panics

Panics when data does match the regular expression.

source

fn assert_no_match(&self, data: &[u8])

§Panics

Panics when data does not match the regular expression.

Implementors§

source§

impl<F: Fn(&[u8]) -> Option<()>> IsMatch for Matcher0<F>

source§

impl<F: Fn(&[u8]) -> Option<[Range<usize>; 1]>> IsMatch for Matcher1<F>

source§

impl<F: Fn(&[u8]) -> Option<[Range<usize>; 2]>> IsMatch for Matcher2<F>

source§

impl<F: Fn(&[u8]) -> Option<[Range<usize>; 3]>> IsMatch for Matcher3<F>

source§

impl<F: Fn(&[u8]) -> Option<[Range<usize>; 4]>> IsMatch for Matcher4<F>

source§

impl<F: Fn(&[u8]) -> Option<[Range<usize>; 5]>> IsMatch for Matcher5<F>

source§

impl<F: Fn(&[u8]) -> Option<[Range<usize>; 6]>> IsMatch for Matcher6<F>

source§

impl<F: Fn(&[u8]) -> Option<[Range<usize>; 7]>> IsMatch for Matcher7<F>

source§

impl<F: Fn(&[u8]) -> Option<[Range<usize>; 8]>> IsMatch for Matcher8<F>

source§

impl<F: Fn(&[u8]) -> Option<[Range<usize>; 9]>> IsMatch for Matcher9<F>

source§

impl<F: Fn(&[u8]) -> Option<[Range<usize>; 10]>> IsMatch for Matcher10<F>