Struct predicates::function::FnPredicate [−][src]
Predicate that wraps a function over a reference that returns a bool
.
This type is returned by the predicate::function
function.
Implementations
impl<F, T> FnPredicate<F, T> where
F: Fn(&T) -> bool,
T: ?Sized,
[src]
impl<F, T> FnPredicate<F, T> where
F: Fn(&T) -> bool,
T: ?Sized,
[src]pub fn fn_name(self, name: &'static str) -> Self
[src]
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: Clone, T> Clone for FnPredicate<F, T> where
F: Fn(&T) -> bool,
T: Clone + ?Sized,
[src]
impl<F: Clone, T> Clone for FnPredicate<F, T> where
F: Fn(&T) -> bool,
T: Clone + ?Sized,
[src]fn clone(&self) -> FnPredicate<F, T>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<F: PartialEq, T> PartialEq<FnPredicate<F, T>> for FnPredicate<F, T> where
F: Fn(&T) -> bool,
T: PartialEq + ?Sized,
[src]
impl<F: PartialEq, T> PartialEq<FnPredicate<F, T>> for FnPredicate<F, T> where
F: Fn(&T) -> bool,
T: PartialEq + ?Sized,
[src]fn eq(&self, other: &FnPredicate<F, T>) -> bool
[src]
fn ne(&self, other: &FnPredicate<F, T>) -> bool
[src]
impl<F, T> PredicateReflection for FnPredicate<F, T> where
F: Fn(&T) -> bool,
T: ?Sized,
[src]
impl<F, T> PredicateReflection for FnPredicate<F, T> where
F: Fn(&T) -> bool,
T: ?Sized,
[src]impl<F, T> StructuralEq for FnPredicate<F, T> where
F: Fn(&T) -> bool,
T: ?Sized,
[src]
impl<F, T> StructuralEq for FnPredicate<F, T> where
F: Fn(&T) -> bool,
T: ?Sized,
[src]impl<F, T> StructuralPartialEq for FnPredicate<F, T> where
F: Fn(&T) -> bool,
T: ?Sized,
[src]
impl<F, T> StructuralPartialEq for FnPredicate<F, T> where
F: Fn(&T) -> bool,
T: ?Sized,
[src]Auto Trait Implementations
impl<F, T: ?Sized> RefUnwindSafe for FnPredicate<F, T> where
F: RefUnwindSafe,
T: RefUnwindSafe,
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> 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> 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> Unpin for FnPredicate<F, T> where
F: Unpin,
T: Unpin,
impl<F, T: ?Sized> UnwindSafe for FnPredicate<F, T> where
F: UnwindSafe,
T: UnwindSafe,
impl<F, T: ?Sized> UnwindSafe for FnPredicate<F, T> where
F: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<P, Item> PredicateBooleanExt<Item> for P where
Item: ?Sized,
P: Predicate<Item>,
[src]
impl<P, Item> PredicateBooleanExt<Item> for P where
Item: ?Sized,
P: Predicate<Item>,
[src]fn and<B>(self, other: B) -> AndPredicate<Self, B, Item> where
B: Predicate<Item>,
Self: Sized,
[src]
B: Predicate<Item>,
Self: Sized,
fn or<B>(self, other: B) -> OrPredicate<Self, B, Item> where
B: Predicate<Item>,
Self: Sized,
[src]
B: Predicate<Item>,
Self: Sized,
fn not(self) -> NotPredicate<Self, Item> where
Self: Sized,
[src]
Self: Sized,
impl<P, Item> PredicateNameExt<Item> for P where
Item: ?Sized,
P: Predicate<Item>,
[src]
impl<P, Item> PredicateNameExt<Item> for P where
Item: ?Sized,
P: Predicate<Item>,
[src]fn name(self, name: &'static str) -> NamePredicate<Self, Item> where
Self: Sized,
[src]
Self: Sized,