[][src]Struct warp::reject::Rejection

pub struct Rejection { /* fields omitted */ }

Rejection of a request by a Filter.

See the reject documentation for more.


impl Rejection[src]

pub fn find<T: 'static>(&self) -> Option<&T>[src]

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.


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);

pub fn is_not_found(&self) -> bool[src]

Returns true if this Rejection was made via warp::reject::not_found.


let rejection = warp::reject();


Trait Implementations

impl Debug for Rejection[src]

impl From<Infallible> for Rejection[src]

impl<T: Reject> From<T> for Rejection[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,