Filter

Trait Filter 

Source
pub trait Filter:
    Send
    + Sync
    + Debug {
    // Required method
    fn matches(&self, req: &RequestContext<'_, '_>) -> bool;
}
Expand description

Core trait for request filtering.

Implementors of this trait can be used to filter HTTP requests based on custom logic. Filters can be composed using AllFilter and AnyFilter.

The Filter trait requires Send + Sync, ensuring that filters can be safely used in a multithreaded environment.

Required Methods§

Source

fn matches(&self, req: &RequestContext<'_, '_>) -> bool

Check if the request matches this filter’s criteria.

Returns true if the request should be allowed, false otherwise.

Implementors§