pub struct Rejection { /* private fields */ }Implementations§
source§impl Rejection
impl Rejection
sourcepub fn find<T: 'static>(&self) -> Option<&T>
pub fn find<T: 'static>(&self) -> Option<&T>
Searches this Rejection for a specific cause.
A Rejection will accumulate causes over a Filter chain. This method
can search through them and return the first cause of this type.
Example
#[derive(Debug)]
struct Nope;
impl warp::reject::Reject for Nope {}
let reject = warp::reject::custom(Nope);
if let Some(nope) = reject.find::<Nope>() {
println!("found it: {:?}", nope);
}sourcepub fn is_not_found(&self) -> bool
pub fn is_not_found(&self) -> bool
Returns true if this Rejection was made via warp::reject::not_found.
Example
let rejection = warp::reject();
assert!(rejection.is_not_found());Trait Implementations§
source§impl From<Infallible> for Rejection
impl From<Infallible> for Rejection
source§fn from(infallible: Infallible) -> Rejection
fn from(infallible: Infallible) -> Rejection
Converts to this type from the input type.