Trait predicates::prelude::Predicate [−][src]
pub trait Predicate<Item>: PredicateReflection where
Item: ?Sized, { pub fn eval(&self, variable: &Item) -> bool; pub fn find_case(
&'a self,
expected: bool,
variable: &Item
) -> Option<Case<'a>> { ... } }
Trait for generically evaluating a type against a dynamically created predicate function.
The exact meaning of eval
depends on the situation, but will usually
mean that the evaluated item is in some sort of pre-defined set. This is
different from Ord
and Eq
in that an item
will almost never be the
same type as the implementing Predicate
type.
Required methods
pub fn eval(&self, variable: &Item) -> bool
[src]
Execute this Predicate
against variable
, returning the resulting
boolean.
Provided methods
pub fn find_case(&'a self, expected: bool, variable: &Item) -> Option<Case<'a>>
[src]
Find a case that proves this predicate as expected
when run against variable
.
Implementors
impl Predicate<f64> for IsClosePredicate
[src]
impl Predicate<f64> for IsClosePredicate
[src]impl Predicate<str> for StrFilePredicate
[src]
impl Predicate<str> for StrFilePredicate
[src]impl Predicate<str> for ContainsPredicate
[src]
impl Predicate<str> for ContainsPredicate
[src]impl Predicate<str> for DifferencePredicate
[src]
impl Predicate<str> for DifferencePredicate
[src]impl Predicate<str> for EndsWithPredicate
[src]
impl Predicate<str> for EndsWithPredicate
[src]impl Predicate<str> for IsEmptyPredicate
[src]
impl Predicate<str> for IsEmptyPredicate
[src]impl Predicate<str> for MatchesPredicate
[src]
impl Predicate<str> for MatchesPredicate
[src]impl Predicate<str> for RegexPredicate
[src]
impl Predicate<str> for RegexPredicate
[src]impl Predicate<str> for StartsWithPredicate
[src]
impl Predicate<str> for StartsWithPredicate
[src]impl Predicate<Path> for BinaryFilePredicate
[src]
impl Predicate<Path> for BinaryFilePredicate
[src]impl Predicate<Path> for ExistencePredicate
[src]
impl Predicate<Path> for ExistencePredicate
[src]impl Predicate<Path> for FileTypePredicate
[src]
impl Predicate<Path> for FileTypePredicate
[src]impl Predicate<Path> for StrFilePredicate
[src]
impl Predicate<Path> for StrFilePredicate
[src]impl<'a, T: ?Sized> Predicate<T> for OrdPredicate<&'a T> where
T: Debug + PartialOrd,
[src]
impl<'a, T: ?Sized> Predicate<T> for OrdPredicate<&'a T> where
T: Debug + PartialOrd,
[src]impl<Item> Predicate<Item> for BoxPredicate<Item> where
Item: ?Sized,
[src]
impl<Item> Predicate<Item> for BoxPredicate<Item> where
Item: ?Sized,
[src]impl<Item: ?Sized> Predicate<Item> for BooleanPredicate
[src]
impl<Item: ?Sized> Predicate<Item> for BooleanPredicate
[src]impl<M1, M2, Item> Predicate<Item> for AndPredicate<M1, M2, Item> where
M1: Predicate<Item>,
M2: Predicate<Item>,
Item: ?Sized,
[src]
impl<M1, M2, Item> Predicate<Item> for AndPredicate<M1, M2, Item> where
M1: Predicate<Item>,
M2: Predicate<Item>,
Item: ?Sized,
[src]impl<M1, M2, Item> Predicate<Item> for OrPredicate<M1, M2, Item> where
M1: Predicate<Item>,
M2: Predicate<Item>,
Item: ?Sized,
[src]
impl<M1, M2, Item> Predicate<Item> for OrPredicate<M1, M2, Item> where
M1: Predicate<Item>,
M2: Predicate<Item>,
Item: ?Sized,
[src]impl<M, Item> Predicate<Item> for NotPredicate<M, Item> where
M: Predicate<Item>,
Item: ?Sized,
[src]
impl<M, Item> Predicate<Item> for NotPredicate<M, Item> where
M: Predicate<Item>,
Item: ?Sized,
[src]impl<M, Item> Predicate<Item> for NamePredicate<M, Item> where
M: Predicate<Item>,
Item: ?Sized,
[src]
impl<M, Item> Predicate<Item> for NamePredicate<M, Item> where
M: Predicate<Item>,
Item: ?Sized,
[src]impl<T> Predicate<T> for InPredicate<T> where
T: PartialEq + Debug,
[src]
impl<T> Predicate<T> for InPredicate<T> where
T: PartialEq + Debug,
[src]impl<T> Predicate<T> for OrdInPredicate<T> where
T: Ord + Debug,
[src]
impl<T> Predicate<T> for OrdInPredicate<T> where
T: Ord + Debug,
[src]impl<T> Predicate<T> for EqPredicate<T> where
T: Debug + PartialEq,
[src]
impl<T> Predicate<T> for EqPredicate<T> where
T: Debug + PartialEq,
[src]