Trait tower_fallthrough_filter::Filter
source · pub trait Filter<T>: Clone {
// Required method
fn matches(&self, item: &T) -> bool;
}Expand description
A filter that allows a service to be executed based on a condition
§Example
#[derive(Debug, Clone)]
struct MyFilter;
impl<T> Filter<T> for MyFilter {
fn matches(&self, _: &T) -> bool {
true
}
}
let filter = MyFilter;
assert_eq!(filter.matches(&()), true);Required Methods§
Object Safety§
This trait is not object safe.