Module predicates::predicate [] [src]

Predicate

This module contains the Predicate trait and a number of combinators for the trait. See the crate docs, and the docs for Predicate, for full detail.

Structs

AndPredicate

Predicate that combines two Predicates, returning the AND of the results.

BooleanPredicate

Predicate that always returns a constant (boolean) result.

BoxPredicate

Predicate that wraps another Predicate as a trait object, allowing sized storage of predicate types.

ContainsPredicate

Predicate that returns true if variable is a member of the pre-defined set, otherwise returns false.

EqPredicate

Predicate that returns true if variable matches the pre-defined Eq value, otherwise returns false.

FnPredicate

Predicate that wraps a function over a reference that returns a bool. This type is returned by the predicate::function function.

HashableContainsPredicate

Predicate that returns true if variable is a member of the pre-defined HashSet, otherwise returns false.

NotPredicate

Predicate that returns a Predicate taking the logical NOT of the result.

OrPredicate

Predicate that combines two Predicates, returning the OR of the results.

OrdContainsPredicate

Predicate that returns true if variable is a member of the pre-defined set, otherwise returns false.

OrdPredicate

Predicate that returns true if variable matches the pre-defined Ord value, otherwise returns false.

Traits

Predicate

Trait for generically evaluating a type against a dynamically created predicate function.

Functions

always

Creates a new Predicate that always returns true.

contains

Creates a new predicate that will return true when the given variable is contained with the set of items provided.

contains_hashable

Creates a new predicate that will return true when the given variable is contained with the set of items provided.

contains_ord

Creates a new predicate that will return true when the given variable is contained with the set of items provided.

eq

Creates a new predicate that will return true when the given variable is equal to a pre-defined value.

function

Creates a new predicate that wraps over the given function. The returned type implements Predicate and therefore has all combinators available to it.

ge

Creates a new predicate that will return true when the given variable is greater than or equal to a pre-defined value.

gt

Creates a new predicate that will return true when the given variable is greater than a pre-defined value.

le

Creates a new predicate that will return true when the given variable is less than or equal to a pre-defined value.

lt

Creates a new predicate that will return true when the given variable is less than a pre-defined value.

ne

Creates a new predicate that will return true when the given variable is not equal to a pre-defined value.

never

Creates a new Predicate that always returns false.