pub struct Error { /* private fields */ }Expand description
General purpose actix web error.
An actix web error is used to carry errors from std::error
through actix in a convenient way. It can be created through
converting errors with into().
Whenever it is created from an external object a response error is created
for it that can be used to create an http response from it this means that
if you have access to an actix Error you can always get a
ResponseError reference from it.
Implementations§
Source§impl Error
impl Error
Sourcepub fn as_response_error(&self) -> &dyn ResponseError
pub fn as_response_error(&self) -> &dyn ResponseError
Returns the reference to the underlying ResponseError.
Sourcepub fn as_error<T>(&self) -> Option<&T>where
T: ResponseError + 'static,
pub fn as_error<T>(&self) -> Option<&T>where
T: ResponseError + 'static,
Similar to as_response_error but downcasts.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn cause(&self) -> Option<&dyn Error>
fn cause(&self) -> Option<&dyn Error>
👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
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 From<Error> for DispatchError
impl From<Error> for DispatchError
Source§fn from(original: Error) -> DispatchError
fn from(original: Error) -> DispatchError
Converts to this type from the input type.
Source§impl From<Error> for SendRequestError
impl From<Error> for SendRequestError
Source§fn from(original: Error) -> SendRequestError
fn from(original: Error) -> SendRequestError
Converts to this type from the input type.
Source§impl From<ResponseBuilder> for Error
Convert ResponseBuilder to a Error
impl From<ResponseBuilder> for Error
Convert ResponseBuilder to a Error
Source§fn from(res: ResponseBuilder) -> Error
fn from(res: ResponseBuilder) -> Error
Converts to this type from the input type.
Source§impl From<Infallible> for Error
impl From<Infallible> for Error
Source§fn from(_: Infallible) -> Error
fn from(_: Infallible) -> Error
Converts to this type from the input type.
Source§impl<T> From<T> for Errorwhere
T: ResponseError + 'static,
Error for any error that implements ResponseError
impl<T> From<T> for Errorwhere
T: ResponseError + 'static,
Error for any error that implements ResponseError
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoSql for T
impl<T> IntoSql for T
Source§fn into_sql<T>(self) -> Self::Expressionwhere
Self: Sized + AsExpression<T>,
fn into_sql<T>(self) -> Self::Expressionwhere
Self: Sized + AsExpression<T>,
Convert
self to an expression for Diesel’s query builder. Read moreSource§fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expressionwhere
&'a Self: AsExpression<T>,
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expressionwhere
&'a Self: AsExpression<T>,
Convert
&self to an expression for Diesel’s query builder. Read more