Trait inline_c::predicates::Predicate [−]
pub trait Predicate<Item>: PredicateReflection where
Item: ?Sized, { fn eval(&self, variable: &Item) -> bool; fn find_case(&'a self, expected: bool, variable: &Item) -> Option<Case<'a>> { ... } }
Expand description
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
fn eval(&self, variable: &Item) -> bool
Expand description
Execute this Predicate
against variable
, returning the resulting
boolean.
Provided methods
fn find_case(&'a self, expected: bool, variable: &Item) -> Option<Case<'a>>
Expand description
Find a case that proves this predicate as expected
when run against variable
.
Implementations on Foreign Types
impl Predicate<Path> for ExistencePredicate
[src]
impl Predicate<Path> for ExistencePredicate
[src]impl Predicate<str> for RegexPredicate
[src]
impl Predicate<str> for RegexPredicate
[src]impl Predicate<Path> for FileTypePredicate
[src]
impl Predicate<Path> for FileTypePredicate
[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<M1, M2, Item> Predicate<Item> for OrPredicate<M1, M2, Item> where
Item: ?Sized,
M1: Predicate<Item>,
M2: Predicate<Item>,
[src]
impl<M1, M2, Item> Predicate<Item> for OrPredicate<M1, M2, Item> where
Item: ?Sized,
M1: Predicate<Item>,
M2: Predicate<Item>,
[src]impl<T> Predicate<T> for InPredicate<T> where
T: PartialEq<T> + Debug,
[src]
impl<T> Predicate<T> for InPredicate<T> where
T: PartialEq<T> + Debug,
[src]impl<'a, T> Predicate<T> for OrdPredicate<&'a T> where
T: Debug + PartialOrd<T> + ?Sized,
[src]
impl<'a, T> Predicate<T> for OrdPredicate<&'a T> where
T: Debug + PartialOrd<T> + ?Sized,
[src]impl Predicate<str> for EndsWithPredicate
[src]
impl Predicate<str> for EndsWithPredicate
[src]impl<Item> Predicate<Item> for BoxPredicate<Item> where
Item: ?Sized,
[src]
impl<Item> Predicate<Item> for BoxPredicate<Item> where
Item: ?Sized,
[src]impl Predicate<Path> for BinaryFilePredicate
[src]
impl Predicate<Path> for BinaryFilePredicate
[src]impl Predicate<str> for StrFilePredicate
[src]
impl Predicate<str> for StrFilePredicate
[src]impl Predicate<str> for IsEmptyPredicate
[src]
impl Predicate<str> for IsEmptyPredicate
[src]impl Predicate<f64> for IsClosePredicate
[src]
impl Predicate<f64> for IsClosePredicate
[src]impl<Item> Predicate<Item> for BooleanPredicate where
Item: ?Sized,
[src]
impl<Item> Predicate<Item> for BooleanPredicate where
Item: ?Sized,
[src]impl Predicate<str> for ContainsPredicate
[src]
impl Predicate<str> for ContainsPredicate
[src]impl Predicate<Path> for StrFilePredicate
[src]
impl Predicate<Path> for StrFilePredicate
[src]impl Predicate<str> for StartsWithPredicate
[src]
impl Predicate<str> for StartsWithPredicate
[src]impl<M1, M2, Item> Predicate<Item> for AndPredicate<M1, M2, Item> where
Item: ?Sized,
M1: Predicate<Item>,
M2: Predicate<Item>,
[src]
impl<M1, M2, Item> Predicate<Item> for AndPredicate<M1, M2, Item> where
Item: ?Sized,
M1: Predicate<Item>,
M2: Predicate<Item>,
[src]impl Predicate<str> for DifferencePredicate
[src]
impl Predicate<str> for DifferencePredicate
[src]impl<M, Item> Predicate<Item> for NamePredicate<M, Item> where
Item: ?Sized,
M: Predicate<Item>,
[src]
impl<M, Item> Predicate<Item> for NamePredicate<M, Item> where
Item: ?Sized,
M: Predicate<Item>,
[src]impl Predicate<str> for MatchesPredicate
[src]
impl Predicate<str> for MatchesPredicate
[src]impl<T> Predicate<T> for EqPredicate<T> where
T: Debug + PartialEq<T>,
[src]
impl<T> Predicate<T> for EqPredicate<T> where
T: Debug + PartialEq<T>,
[src]impl<T> Predicate<T> for OrdPredicate<T> where
T: Debug + PartialOrd<T>,
[src]
impl<T> Predicate<T> for OrdPredicate<T> where
T: Debug + PartialOrd<T>,
[src]impl<M, Item> Predicate<Item> for NotPredicate<M, Item> where
Item: ?Sized,
M: Predicate<Item>,
[src]
impl<M, Item> Predicate<Item> for NotPredicate<M, Item> where
Item: ?Sized,
M: Predicate<Item>,
[src]impl Predicate<i32> for EqCodePredicate
[src]
impl Predicate<i32> for EqCodePredicate
[src]impl Predicate<i32> for InCodePredicate
[src]
impl Predicate<i32> for InCodePredicate
[src]