pub struct Error {
pub status: StatusCode,
pub headers: HeaderMap,
pub error: Error,
}Expand description
Intermediate error type which can be converted to from any error using ?.
The standard impl From<E> for Error will attach StatusCode::INTERNAL_SERVER_ERROR,
so if an alternative StatusCode is desired, you should use .status_code (AddStatusCode or AddStatusCodeError)
to add the status and .header ([AddHeader] or [AddHeaderError]) before using ?.
Fields§
§status: StatusCode§headers: HeaderMap§error: ErrorImplementations§
Source§impl Error
impl Error
pub fn status_code(self, status_code: StatusCode) -> Error
pub fn header(self, name: impl IntoHeaderName, value: HeaderValue) -> Error
pub fn headers(self, headers: HeaderMap) -> Error
Trait Implementations§
Source§impl IntoResponse for Error
impl IntoResponse for Error
Source§fn into_response(self) -> Response
fn into_response(self) -> Response
Create a response.
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnwindSafe for Error
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