pub struct Rejection { /* private fields */ }
Implementations
sourceimpl 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
sourceimpl From<Infallible> for Rejection
impl From<Infallible> for Rejection
sourcefn from(infallible: Infallible) -> Rejection
fn from(infallible: Infallible) -> Rejection
Converts to this type from the input type.
Auto Trait Implementations
impl !RefUnwindSafe for Rejection
impl Send for Rejection
impl Sync for Rejection
impl Unpin for Rejection
impl !UnwindSafe for Rejection
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more