pub struct FilterPredicate(pub Arc<dyn Fn(&Exchange) -> bool + Send + Sync>);Expand description
Predicate that determines whether an exchange passes the filter.
Returns true to forward the exchange into the filter body; false to skip it.
This is a newtype around Arc<dyn Fn(&Exchange) -> bool + Send + Sync> so that
it can implement Debug (used by #[derive(Debug)] on BuilderStep and friends).
The Deref impl keeps the call-site ergonomic: predicate(&exchange) still works
because FilterPredicate derefs to the inner dyn Fn.
Pre-v1.0: this used to be a type alias. Converted to a newtype (H2) so the
containing structs (WhenStep, etc.) can be #[derive(Debug)].
Tuple Fields§
§0: Arc<dyn Fn(&Exchange) -> bool + Send + Sync>Implementations§
Trait Implementations§
Source§impl Clone for FilterPredicate
impl Clone for FilterPredicate
Source§impl Debug for FilterPredicate
impl Debug for FilterPredicate
Auto Trait Implementations§
impl !RefUnwindSafe for FilterPredicate
impl !UnwindSafe for FilterPredicate
impl Freeze for FilterPredicate
impl Send for FilterPredicate
impl Sync for FilterPredicate
impl Unpin for FilterPredicate
impl UnsafeUnpin for FilterPredicate
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more