Struct predicates::str::ContainsPredicate [−][src]
pub struct ContainsPredicate { /* fields omitted */ }
Predicate that checks for patterns.
This is created by predicates::str:contains
.
Methods
impl ContainsPredicate
[src]
impl ContainsPredicate
pub fn count(self, count: usize) -> MatchesPredicate
[src]
pub fn count(self, count: usize) -> MatchesPredicate
Require a specific count of matches.
Examples
use predicates::prelude::*; let predicate_fn = predicate::str::contains("Two").count(2); assert_eq!(true, predicate_fn.eval("One Two Three Two One")); assert_eq!(false, predicate_fn.eval("One Two Three"));
Trait Implementations
impl Clone for ContainsPredicate
[src]
impl Clone for ContainsPredicate
fn clone(&self) -> ContainsPredicate
[src]
fn clone(&self) -> ContainsPredicate
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 Debug for ContainsPredicate
[src]
impl Debug for ContainsPredicate
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 Predicate<str> for ContainsPredicate
[src]
impl Predicate<str> for ContainsPredicate
fn eval(&self, variable: &str) -> bool
[src]
fn eval(&self, variable: &str) -> bool
Execute this Predicate
against variable
, returning the resulting boolean. Read more
impl Display for ContainsPredicate
[src]
impl Display for ContainsPredicate
Auto Trait Implementations
impl Send for ContainsPredicate
impl Send for ContainsPredicate
impl Sync for ContainsPredicate
impl Sync for ContainsPredicate