Skip to main content

Predicate

Trait Predicate 

Source
pub trait Predicate<T>: Copy {
    // Required method
    fn check(&mut self, thing: &T) -> bool;
}
Expand description

Trait for predicates that check if a value matches them.

Required Methods§

Source

fn check(&mut self, thing: &T) -> bool

Check if the predicate matches the given value.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<T> Predicate<T> for Always

Source§

impl<T, F> Predicate<T> for F
where F: Fn(&T) -> bool + Copy,

Source§

impl<T, Patt: AsRef<str> + Copy> Predicate<Response<T>> for ContentTypeStartsWith<Patt>