Trait predicates::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.

Loading content...

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.

Loading content...

Implementors

impl Predicate<f64> for IsClosePredicate[src]

impl Predicate<[u8]> for BinaryFilePredicate[src]

impl Predicate<str> for StrFilePredicate[src]

impl Predicate<str> for ContainsPredicate[src]

impl Predicate<str> for DifferencePredicate[src]

impl Predicate<str> for EndsWithPredicate[src]

impl Predicate<str> for IsEmptyPredicate[src]

impl Predicate<str> for MatchesPredicate[src]

impl Predicate<str> for RegexPredicate[src]

impl Predicate<str> for StartsWithPredicate[src]

impl Predicate<Path> for BinaryFilePredicate[src]

impl Predicate<Path> for ExistencePredicate[src]

impl Predicate<Path> for FileTypePredicate[src]

impl Predicate<Path> for StrFilePredicate[src]

impl<'a, T: ?Sized> Predicate<T> for HashableInPredicate<&'a T> where
    T: Hash + Eq + Debug
[src]

impl<'a, T: ?Sized> Predicate<T> for InPredicate<&'a T> where
    T: PartialEq + Debug
[src]

impl<'a, T: ?Sized> Predicate<T> for OrdInPredicate<&'a T> where
    T: Ord + Debug
[src]

impl<'a, T: ?Sized> Predicate<T> for EqPredicate<&'a T> where
    T: Debug + PartialEq
[src]

impl<'a, T: ?Sized> Predicate<T> for OrdPredicate<&'a T> where
    T: Debug + PartialOrd
[src]

impl<F, T> Predicate<T> for FnPredicate<F, T> where
    F: Fn(&T) -> bool,
    T: ?Sized
[src]

impl<Item> Predicate<Item> for BoxPredicate<Item> where
    Item: ?Sized
[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 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 NamePredicate<M, Item> where
    M: Predicate<Item>,
    Item: ?Sized
[src]

impl<P> Predicate<[u8]> for Utf8Predicate<P> where
    P: Predicate<str>, 
[src]

impl<P> Predicate<str> for NormalizedPredicate<P> where
    P: Predicate<str>, 
[src]

impl<P> Predicate<str> for TrimPredicate<P> where
    P: Predicate<str>, 
[src]

impl<P> Predicate<OsStr> for Utf8Predicate<P> where
    P: Predicate<str>, 
[src]

impl<P> Predicate<Path> for FileContentPredicate<P> where
    P: Predicate<[u8]>, 
[src]

impl<T> Predicate<T> for HashableInPredicate<T> where
    T: Hash + Eq + 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 EqPredicate<T> where
    T: Debug + PartialEq
[src]

impl<T> Predicate<T> for OrdPredicate<T> where
    T: Debug + PartialOrd
[src]

Loading content...