[−][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
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
try_from
)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> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Same for T
type Output = T
Should always be Self