Skip to main content

FilterFn

Trait FilterFn 

Source
pub trait FilterFn:
    Send
    + Sync
    + 'static {
    // Required method
    fn filter(&self, request: &Request<Body>) -> bool;
}
Expand description

Used by the Filter HttpResponder to decide which requests to forward and which to ignore.

Required Methods§

Source

fn filter(&self, request: &Request<Body>) -> bool

Return true iff Filter should forward the request to its wrapped Responder.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<F> FilterFn for F
where F: Fn(&Request<Body>) -> bool + Send + Sync + 'static,