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 RegexPredicate
pub fn count(self, count: usize) -> RegexMatchesPredicate
[src]
pub fn count(self, count: usize) -> RegexMatchesPredicate
Require 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 RegexPredicate
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Clone for RegexPredicate
[src]
impl Clone for RegexPredicate
fn clone(&self) -> RegexPredicate
[src]
fn clone(&self) -> RegexPredicate
Returns 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 RegexPredicate
fn eval(&self, variable: &str) -> bool
[src]
fn eval(&self, variable: &str) -> bool
Execute 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 Predicate
s of the current Predicate
.
impl Display for RegexPredicate
[src]
impl Display for RegexPredicate
Auto Trait Implementations
impl Send for RegexPredicate
impl Send for RegexPredicate
impl Sync for RegexPredicate
impl Sync for RegexPredicate