Struct predicates::str::RegexPredicate [−][src]
pub struct RegexPredicate { /* fields omitted */ }Predicate that uses regex matching
This is created by the predicate::str::is_match.
Methods
impl RegexPredicate[src]
impl RegexPredicatepub fn count(self, count: usize) -> RegexMatchesPredicate[src]
pub fn count(self, count: usize) -> RegexMatchesPredicateRequire a specific count of matches.
Examples
use predicates::prelude::*; let predicate_fn = predicate::str::is_match("T[a-z]*").unwrap().count(3); assert_eq!(true, predicate_fn.eval("One Two Three Two One")); assert_eq!(false, predicate_fn.eval("One Two Three"));
Trait Implementations
impl Debug for RegexPredicate[src]
impl Debug for RegexPredicatefn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl Clone for RegexPredicate[src]
impl Clone for RegexPredicatefn clone(&self) -> RegexPredicate[src]
fn clone(&self) -> RegexPredicateReturns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)1.0.0
[src]Performs copy-assignment from source. Read more
impl Predicate<str> for RegexPredicate[src]
impl Predicate<str> for RegexPredicatefn eval(&self, variable: &str) -> bool[src]
fn eval(&self, variable: &str) -> boolExecute this Predicate against variable, returning the resulting boolean. Read more
fn find_case<'a>(&'a self, expected: bool, variable: &str) -> Option<Case<'a>>[src]
fn find_case<'a>(&'a self, expected: bool, variable: &str) -> Option<Case<'a>>Find a case that proves this predicate as expected when run against variable.
impl PredicateReflection for RegexPredicate[src]
impl PredicateReflection for RegexPredicateⓘImportant traits for Box<R>fn parameters(&'a self) -> Box<Iterator<Item = Parameter<'a>> + 'a>[src]
ⓘImportant traits for Box<R>
fn parameters(&'a self) -> Box<Iterator<Item = Parameter<'a>> + 'a>Parameters of the current Predicate.
ⓘImportant traits for Box<R>fn children(&'a self) -> Box<Iterator<Item = Child<'a>> + 'a>[src]
ⓘImportant traits for Box<R>
fn children(&'a self) -> Box<Iterator<Item = Child<'a>> + 'a>Nested Predicates of the current Predicate.
impl Display for RegexPredicate[src]
impl Display for RegexPredicateAuto Trait Implementations
impl Send for RegexPredicate
impl Send for RegexPredicateimpl Sync for RegexPredicate
impl Sync for RegexPredicate