[−][src]Struct warp::reject::Rejection
Methods
impl Rejection
[src]
pub fn find_cause<T: StdError + '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
use std::io; let err = io::Error::new( io::ErrorKind::Other, "could be any std::error::Error" ); let reject = warp::reject::custom(err); if let Some(cause) = reject.find_cause::<io::Error>() { println!("found the io::Error: {}", cause); }
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::not_found(); assert!(rejection.is_not_found());
pub fn cause(&self) -> Option<&Cause>
[src]
Returns an optional error cause for this rejection.
If this Rejection
is actuall a combination of rejections, then the
returned cause is determined by an internal ranking system. If you'd
rather handle different causes with different priorities, use
find_cause
.
Note
The return type will change from &Box<Error>
to &Error
in v0.2.
This method isn't marked deprecated, however, since most people aren't
actually using the Box
part, and so a deprecation warning would just
annoy people who didn't need to make any changes.
Trait Implementations
Auto Trait Implementations
impl Send for Rejection
impl Unpin for Rejection
impl Sync for Rejection
impl !UnwindSafe for Rejection
impl !RefUnwindSafe for Rejection
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> Erased for T
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,