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

pub struct Rejection { /* fields omitted */ }

Rejection of a request by a Filter.

See the reject documentation for more.

Implementations

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.

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

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

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

Example

let rejection = warp::reject();

assert!(rejection.is_not_found());

Trait Implementations

impl Debug for Rejection[src]

impl From<Infallible> for Rejection[src]

Auto Trait Implementations

Blanket Implementations

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

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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>,