pub fn is_match(&self, text: &str) -> Option<PatternMatchResult> {
        // try to match critical pattern first
        if let Some(critical) = &self.critical {
            trace!("critical pattern is tried");
            let ret = critical
                .is_match(text)
                .map(|re| PatternMatchResult::new(PatternType::critical, re));
            if ret.is_some() {
                trace!("critical pattern is matching");
                return ret;
            }
        }

        // and then warning
        if let Some(warning) = &self.warning {
            trace!("warning pattern is tried");
            let ret = warning
                .is_match(text)
                .map(|re| PatternMatchResult::new(PatternType::warning, re));
            if ret.is_some() {
                trace!("warning pattern is matching");
                return ret;
            }
        }

        // and finally ok
        if let Some(ok) = &self.ok {
            trace!("ok pattern is tried");
            let ret = ok
                .is_match(text)
                .map(|re| PatternMatchResult::new(PatternType::ok, re));
            if ret.is_some() {
                trace!("ok pattern is matching");
                return ret;
            }
        }

        None
    }
/// Returns whether a critical or warning regex is involved in the match, provided no exception is matched.
Returns whether a critical or warning regex is involved in the match, provided no exception is matched.
Returns whether a critical or warning regex is involved in the match provided no exception is matched .
pub fn is_match(&self, text: &str) -> Option<PatternMatchResult> {
        // try to match critical pattern first
        if let Some(critical) = &self.critical {
            trace!("critical pattern is tried");
            let ret = critical
                .is_match(text)
                .map(|re| PatternMatchResult::new(PatternType::critical, re));
            if ret.is_some() {
                trace!("critical pattern is matching");
                return ret;
            }
        }
        // and then warning
        if let Some(warning) = &self.warning {
            trace!("warning pattern is tried");
            let ret = warning
                .is_match(text)
                .map(|re| PatternMatchResult::new(PatternType::warning, re));
            if ret.is_some() {
                trace!("warning pattern is matching");
                return ret;
            }
        }
        // and finally ok
        if let Some(ok) = &self.ok {
            trace!("ok pattern is tried");
            let ret = ok
                .is_match(text)
                .map(|re| PatternMatchResult::new(PatternType::ok, re));
            if ret.is_some() {
                trace!("ok pattern is matching");
                return ret;
            }
        }
        None
    }
pub fn is_match ( & self , text : & str ) -> Option < PatternMatchResult > { // try to match critical pattern first if let Some ( critical ) = & self . critical { trace ! ( " " ) ; let ret = critical . is_match ( text ) . map ( | re | PatternMatchResult :: new ( PatternType :: critical , re ) ) ; if ret . is_some ( ) { trace ! ( " " ) ; return ret ; } } // and then warning if let Some ( warning ) = & self . warning { trace ! ( " " ) ; let ret = warning . is_match ( text ) . map ( | re | PatternMatchResult :: new ( PatternType :: warning , re ) ) ; if ret . is_some ( ) { trace ! ( " " ) ; return ret ; } } // and finally ok if let Some ( ok ) = & self . ok { trace ! ( " " ) ; let ret = ok . is_match ( text ) . map ( | re | PatternMatchResult :: new ( PatternType :: ok , re ) ) ; if ret . is_some ( ) { trace ! ( " " ) ; return ret ; } } None }
Returns whether a critical or warning regex is involved in the match, provided no exception is matched.
Returns whether a critical or warning regex is involved in the match provided no exception is matched .
&self
text
&str
&self
text
&str