Struct predicates::function::FnPredicate [−][src]
Expand description
Predicate that wraps a function over a reference that returns a bool
.
This type is returned by the predicate::function
function.
Implementations
Provide a descriptive name for this function.
Examples
use predicates::prelude::*; struct Example { string: String, number: i32, } let string_check = predicate::function(|x: &Example| x.string == "hello") .fn_name("is_hello"); println!("predicate: {}", string_check);
Trait Implementations
impl<F: PartialEq, T> PartialEq<FnPredicate<F, T>> for FnPredicate<F, T> where
F: Fn(&T) -> bool,
T: PartialEq + ?Sized,
impl<F: PartialEq, T> PartialEq<FnPredicate<F, T>> for FnPredicate<F, T> where
F: Fn(&T) -> bool,
T: PartialEq + ?Sized,
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl<F, T: ?Sized> RefUnwindSafe for FnPredicate<F, T> where
F: RefUnwindSafe,
T: RefUnwindSafe,
impl<F, T: ?Sized> Send for FnPredicate<F, T> where
F: Send,
T: Send,
impl<F, T: ?Sized> Sync for FnPredicate<F, T> where
F: Sync,
T: Sync,
impl<F, T: ?Sized> Unpin for FnPredicate<F, T> where
F: Unpin,
T: Unpin,
impl<F, T: ?Sized> UnwindSafe for FnPredicate<F, T> where
F: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
fn and<B>(self, other: B) -> AndPredicate<Self, B, Item> where
B: Predicate<Item>,
Self: Sized,
fn and<B>(self, other: B) -> AndPredicate<Self, B, Item> where
B: Predicate<Item>,
Self: Sized,
Compute the logical AND of two Predicate
results, returning the result. Read more
Compute the logical OR of two Predicate
results, returning the result. Read more
Compute the logical NOT of a Predicate
, returning the result. Read more