Trait predicates::Predicate [−][src]
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
Provided methods
Implementors
impl<M1, M2, Item> Predicate<Item> for AndPredicate<M1, M2, Item> where
M1: Predicate<Item>,
M2: Predicate<Item>,
Item: ?Sized,
impl<M1, M2, Item> Predicate<Item> for OrPredicate<M1, M2, Item> where
M1: Predicate<Item>,
M2: Predicate<Item>,
Item: ?Sized,
impl<M, Item> Predicate<Item> for NotPredicate<M, Item> where
M: Predicate<Item>,
Item: ?Sized,
impl<M, Item> Predicate<Item> for NamePredicate<M, Item> where
M: Predicate<Item>,
Item: ?Sized,