Skip to main content

MethodPredicate

Trait MethodPredicate 

Source
pub trait MethodPredicate: Sized {
    // Required method
    fn method(self, method: Method) -> Method<Self>;
}
Expand description

Extension trait for adding method matching to a predicate chain.

§For Callers

Chain this to match requests by their HTTP method. Use with specific methods like http::Method::GET or http::Method::POST.

§For Implementors

This trait is automatically implemented for all Predicate types. You don’t need to implement it manually.

Required Methods§

Source

fn method(self, method: Method) -> Method<Self>

Adds an HTTP method match to this predicate chain.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<P> MethodPredicate for P
where P: Predicate,