pub trait Reject:
Debug
+ Sized
+ Send
+ Sync
+ 'static { }
Expand description
A marker trait to ensure proper types are used for custom rejections.
Can be converted into Rejection.
§Example
use warp::{Filter, reject::Reject};
#[derive(Debug)]
struct RateLimited;
impl Reject for RateLimited {}
let route = warp::any().and_then(|| async {
Err::<(), _>(warp::reject::custom(RateLimited))
});
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.