pub trait Filter: Debug + 'static {
    // Required method
    fn filter(&self, url: &Url, truck: &Truck, path: &mut PathState) -> bool;

    // Provided methods
    fn and<F>(self, other: F) -> And<Self, F>
       where Self: Sized,
             F: Filter { ... }
    fn or<F>(self, other: F) -> Or<Self, F>
       where Self: Sized,
             F: Filter { ... }
    fn and_then<F>(self, fun: F) -> AndThen<Self, F>
       where Self: Sized,
             F: Fn(&Url, &Truck, &mut PathState) -> bool + 'static { ... }
    fn or_else<F>(self, fun: F) -> OrElse<Self, F>
       where Self: Sized,
             F: Fn(&Url, &Truck, &mut PathState) -> bool + 'static { ... }
}
Expand description

Fiter trait for filter request.

Required Methods§

source

fn filter(&self, url: &Url, truck: &Truck, path: &mut PathState) -> bool

Filter Request and returns false or true.

Provided Methods§

source

fn and<F>(self, other: F) -> And<Self, F>
where Self: Sized, F: Filter,

Create a new filter use And filter.

source

fn or<F>(self, other: F) -> Or<Self, F>
where Self: Sized, F: Filter,

Create a new filter use Or filter.

source

fn and_then<F>(self, fun: F) -> AndThen<Self, F>
where Self: Sized, F: Fn(&Url, &Truck, &mut PathState) -> bool + 'static,

Create a new filter use AndThen filter.

source

fn or_else<F>(self, fun: F) -> OrElse<Self, F>
where Self: Sized, F: Fn(&Url, &Truck, &mut PathState) -> bool + 'static,

Create a new filter use OrElse filter.

Implementors§

source§

impl Filter for PathFilter

source§

impl<F> Filter for FnFilter<F>
where F: Fn(&Url, &Truck, &mut PathState) -> bool + 'static,