Enum highnoon::Error [−][src]
Error type expected to be returned by endpoints.
It can represent an HTTP level error which is useful for helper functions
that wish to cause an early return from a handler (using the question mark operator).
It can also represent any other kind of error (using the anyhow::Error
type). These
errors are logged (if you enable the logging filter) and converted to a 500 Internal Server Error
with no other details.
HTTP level error should be created with the http
methods (which accepts a Responder
rather tnan
just Response
) and Internal errors should be created with the From
/Into
implementation.
Variants
Http(Response)
An error that should get returned to the client
Internal(Error)
Internal errors, reported as 500 Internal Server Error and logged locally
Implementations
impl Error
[src]
pub fn http(resp: impl Responder) -> Self
[src]
Create an Error from a Responder
- the Responder
will be converted to a response
and returned to the HTTP Client exactly the same way as an Result::Ok
would be.
This is useful in conjunction with the ?
operator for early returns.
Trait Implementations
impl Debug for Error
[src]
impl Display for Error
[src]
impl<E> From<E> for Error where
E: Into<Error>,
[src]
E: Into<Error>,
impl Responder for Error
[src]
fn into_response(self) -> Result<Response>
[src]
Auto Trait Implementations
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl !UnwindSafe for Error
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<!> for T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
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.
pub 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.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,