Trait inline_c::predicates::Predicate [−]
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
Execute this Predicate against variable, returning the resulting
boolean.
Provided methods
pub fn find_case(&'a self, expected: bool, variable: &Item) -> Option<Case<'a>>
Find a case that proves this predicate as expected when run against variable.
Implementations on Foreign Types
impl<Item> Predicate<Item> for BooleanPredicate where
Item: ?Sized, [src]
Item: ?Sized,
pub fn eval(&self, _variable: &Item) -> bool[src]
pub fn find_case(&'a self, expected: bool, variable: &Item) -> Option<Case<'a>>[src]
impl<Item> Predicate<Item> for BoxPredicate<Item> where
Item: ?Sized, [src]
Item: ?Sized,
pub fn eval(&self, variable: &Item) -> bool[src]
pub fn find_case(&'a self, expected: bool, variable: &Item) -> Option<Case<'a>>[src]
impl<T> Predicate<T> for OrdInPredicate<T> where
T: Ord + Debug, [src]
T: Ord + Debug,
pub fn eval(&self, variable: &T) -> bool[src]
pub fn find_case(&'a self, expected: bool, variable: &T) -> Option<Case<'a>>[src]
impl<P> Predicate<str> for NormalizedPredicate<P> where
P: Predicate<str>, [src]
P: Predicate<str>,
pub fn eval(&self, variable: &str) -> bool[src]
pub fn find_case(&'a self, expected: bool, variable: &str) -> Option<Case<'a>>[src]
impl<'a, T> Predicate<T> for OrdPredicate<&'a T> where
T: Debug + PartialOrd<T> + ?Sized, [src]
T: Debug + PartialOrd<T> + ?Sized,
pub fn eval(&self, variable: &T) -> bool[src]
pub fn find_case(&'b self, expected: bool, variable: &T) -> Option<Case<'b>>[src]
impl<'a, T> Predicate<T> for OrdInPredicate<&'a T> where
T: Ord + Debug + ?Sized, [src]
T: Ord + Debug + ?Sized,
pub fn eval(&self, variable: &T) -> bool[src]
pub fn find_case(&'b self, expected: bool, variable: &T) -> Option<Case<'b>>[src]
impl<T> Predicate<T> for InPredicate<T> where
T: PartialEq<T> + Debug, [src]
T: PartialEq<T> + Debug,
pub fn eval(&self, variable: &T) -> bool[src]
pub fn find_case(&'a self, expected: bool, variable: &T) -> Option<Case<'a>>[src]
impl Predicate<Path> for StrFilePredicate[src]
pub fn eval(&self, path: &Path) -> bool[src]
pub fn find_case(&'a self, expected: bool, variable: &Path) -> Option<Case<'a>>[src]
impl<P> Predicate<[u8]> for Utf8Predicate<P> where
P: Predicate<str>, [src]
P: Predicate<str>,
pub fn eval(&self, variable: &[u8]) -> bool[src]
pub fn find_case(&'a self, expected: bool, variable: &[u8]) -> Option<Case<'a>>[src]
impl Predicate<str> for StartsWithPredicate[src]
pub fn eval(&self, variable: &str) -> bool[src]
pub fn find_case(&'a self, expected: bool, variable: &str) -> Option<Case<'a>>[src]
impl Predicate<Path> for ExistencePredicate[src]
pub fn eval(&self, path: &Path) -> bool[src]
pub fn find_case(&'a self, expected: bool, variable: &Path) -> Option<Case<'a>>[src]
impl<P> Predicate<Path> for FileContentPredicate<P> where
P: Predicate<[u8]>, [src]
P: Predicate<[u8]>,
pub fn eval(&self, path: &Path) -> bool[src]
pub fn find_case(&'a self, expected: bool, variable: &Path) -> Option<Case<'a>>[src]
impl<P> Predicate<str> for TrimPredicate<P> where
P: Predicate<str>, [src]
P: Predicate<str>,
pub fn eval(&self, variable: &str) -> bool[src]
pub fn find_case(&'a self, expected: bool, variable: &str) -> Option<Case<'a>>[src]
impl Predicate<str> for DifferencePredicate[src]
pub fn eval(&self, edit: &str) -> bool[src]
pub fn find_case(&'a self, expected: bool, variable: &str) -> Option<Case<'a>>[src]
impl<M, Item> Predicate<Item> for NamePredicate<M, Item> where
Item: ?Sized,
M: Predicate<Item>, [src]
Item: ?Sized,
M: Predicate<Item>,
pub fn eval(&self, item: &Item) -> bool[src]
pub fn find_case(&'a self, expected: bool, variable: &Item) -> Option<Case<'a>>[src]
impl<M, Item> Predicate<Item> for NotPredicate<M, Item> where
Item: ?Sized,
M: Predicate<Item>, [src]
Item: ?Sized,
M: Predicate<Item>,
pub fn eval(&self, item: &Item) -> bool[src]
pub fn find_case(&'a self, expected: bool, variable: &Item) -> Option<Case<'a>>[src]
impl Predicate<str> for MatchesPredicate[src]
pub fn eval(&self, variable: &str) -> bool[src]
pub fn find_case(&'a self, expected: bool, variable: &str) -> Option<Case<'a>>[src]
impl<M1, M2, Item> Predicate<Item> for OrPredicate<M1, M2, Item> where
Item: ?Sized,
M1: Predicate<Item>,
M2: Predicate<Item>, [src]
Item: ?Sized,
M1: Predicate<Item>,
M2: Predicate<Item>,
pub fn eval(&self, item: &Item) -> bool[src]
pub fn find_case(&'a self, expected: bool, variable: &Item) -> Option<Case<'a>>[src]
impl Predicate<Path> for FileTypePredicate[src]
pub fn eval(&self, path: &Path) -> bool[src]
pub fn find_case(&'a self, expected: bool, variable: &Path) -> Option<Case<'a>>[src]
impl<M1, M2, Item> Predicate<Item> for AndPredicate<M1, M2, Item> where
Item: ?Sized,
M1: Predicate<Item>,
M2: Predicate<Item>, [src]
Item: ?Sized,
M1: Predicate<Item>,
M2: Predicate<Item>,
pub fn eval(&self, item: &Item) -> bool[src]
pub fn find_case(&'a self, expected: bool, variable: &Item) -> Option<Case<'a>>[src]
impl<T> Predicate<T> for EqPredicate<T> where
T: Debug + PartialEq<T>, [src]
T: Debug + PartialEq<T>,
pub fn eval(&self, variable: &T) -> bool[src]
pub fn find_case(&'a self, expected: bool, variable: &T) -> Option<Case<'a>>[src]
impl<'a, T> Predicate<T> for EqPredicate<&'a T> where
T: Debug + PartialEq<T> + ?Sized, [src]
T: Debug + PartialEq<T> + ?Sized,
pub fn eval(&self, variable: &T) -> bool[src]
pub fn find_case(&'b self, expected: bool, variable: &T) -> Option<Case<'b>>[src]
impl Predicate<str> for EndsWithPredicate[src]
pub fn eval(&self, variable: &str) -> bool[src]
pub fn find_case(&'a self, expected: bool, variable: &str) -> Option<Case<'a>>[src]
impl Predicate<[u8]> for BinaryFilePredicate[src]
pub fn eval(&self, actual: &[u8]) -> bool[src]
pub fn find_case(&'a self, expected: bool, variable: &[u8]) -> Option<Case<'a>>[src]
impl Predicate<Path> for BinaryFilePredicate[src]
pub fn eval(&self, path: &Path) -> bool[src]
pub fn find_case(&'a self, expected: bool, variable: &Path) -> Option<Case<'a>>[src]
impl<P> Predicate<OsStr> for Utf8Predicate<P> where
P: Predicate<str>, [src]
P: Predicate<str>,
pub fn eval(&self, variable: &OsStr) -> bool[src]
pub fn find_case(&'a self, expected: bool, variable: &OsStr) -> Option<Case<'a>>[src]
impl<'a, T> Predicate<T> for InPredicate<&'a T> where
T: PartialEq<T> + Debug + ?Sized, [src]
T: PartialEq<T> + Debug + ?Sized,
pub fn eval(&self, variable: &T) -> bool[src]
pub fn find_case(&'b self, expected: bool, variable: &T) -> Option<Case<'b>>[src]
impl<F, T> Predicate<T> for FnPredicate<F, T> where
T: ?Sized,
F: Fn(&T) -> bool, [src]
T: ?Sized,
F: Fn(&T) -> bool,
pub fn eval(&self, variable: &T) -> bool[src]
pub fn find_case(&'a self, expected: bool, variable: &T) -> Option<Case<'a>>[src]
impl Predicate<str> for RegexPredicate[src]
pub fn eval(&self, variable: &str) -> bool[src]
pub fn find_case(&'a self, expected: bool, variable: &str) -> Option<Case<'a>>[src]
impl Predicate<str> for ContainsPredicate[src]
pub fn eval(&self, variable: &str) -> bool[src]
pub fn find_case(&'a self, expected: bool, variable: &str) -> Option<Case<'a>>[src]
impl Predicate<f64> for IsClosePredicate[src]
pub fn eval(&self, variable: &f64) -> bool[src]
pub fn find_case(&'a self, expected: bool, variable: &f64) -> Option<Case<'a>>[src]
impl<'a, T> Predicate<T> for HashableInPredicate<&'a T> where
T: Hash + Eq + Debug + ?Sized, [src]
T: Hash + Eq + Debug + ?Sized,
pub fn eval(&self, variable: &T) -> bool[src]
pub fn find_case(&'b self, expected: bool, variable: &T) -> Option<Case<'b>>[src]
impl Predicate<str> for IsEmptyPredicate[src]
pub fn eval(&self, variable: &str) -> bool[src]
pub fn find_case(&'a self, expected: bool, variable: &str) -> Option<Case<'a>>[src]
impl Predicate<str> for StrFilePredicate[src]
pub fn eval(&self, actual: &str) -> bool[src]
pub fn find_case(&'a self, expected: bool, variable: &str) -> Option<Case<'a>>[src]
impl<T> Predicate<T> for OrdPredicate<T> where
T: Debug + PartialOrd<T>, [src]
T: Debug + PartialOrd<T>,
pub fn eval(&self, variable: &T) -> bool[src]
pub fn find_case(&'a self, expected: bool, variable: &T) -> Option<Case<'a>>[src]
impl<T> Predicate<T> for HashableInPredicate<T> where
T: Hash + Eq + Debug, [src]
T: Hash + Eq + Debug,
pub fn eval(&self, variable: &T) -> bool[src]
pub fn find_case(&'a self, expected: bool, variable: &T) -> Option<Case<'a>>[src]
impl<P> Predicate<[u8]> for StrOutputPredicate<P> where
P: Predicate<str>, [src]
P: Predicate<str>,