pub enum AcceptRejection {
InvalidHeader(ToStrError),
InvalidMediaType(usize, MediaTypeError),
InvalidQ(usize, <f64 as FromStr>::Err),
NoSupportedMediaTypeFound,
}
Expand description
The error type returned in the FromRequestParts
implementations.
Variants§
InvalidHeader(ToStrError)
The header could not be converted to a &str.
InvalidMediaType(usize, MediaTypeError)
The media type at index .0 could not be parsed.
InvalidQ(usize, <f64 as FromStr>::Err)
Invalid q parameter
NoSupportedMediaTypeFound
No supported media type was found.
Implementations§
Source§impl AcceptRejection
impl AcceptRejection
Sourcepub fn status_and_message(&self) -> (StatusCode, String)
pub fn status_and_message(&self) -> (StatusCode, String)
Get the status and message for an error.
Trait Implementations§
Source§impl Debug for AcceptRejection
impl Debug for AcceptRejection
Source§impl Display for AcceptRejection
impl Display for AcceptRejection
Source§impl Error for AcceptRejection
impl Error for AcceptRejection
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl IntoResponse for AcceptRejection
impl IntoResponse for AcceptRejection
Source§fn into_response(self) -> Response<Body>
fn into_response(self) -> Response<Body>
Create a response.
Auto Trait Implementations§
impl Freeze for AcceptRejection
impl RefUnwindSafe for AcceptRejection
impl Send for AcceptRejection
impl Sync for AcceptRejection
impl Unpin for AcceptRejection
impl UnwindSafe for AcceptRejection
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more