Struct actix_web_utils::extensions::generic_error::GenericError
source · [−]pub struct GenericError<E: Display> {
pub error: E,
}
Expand description
This is a wrapper for all errors. The error must implement display at least. Usage:
use actix_web_utils::enums::error::Error;
use actix_web_utils::extensions::generic_error::GenericError;
let generic_error = GenericError::wrap(Error::Unspecified);
//Use it as you please
Fields
error: E
Implementations
sourceimpl<E: Display> GenericError<E>
impl<E: Display> GenericError<E>
pub fn wrap(e: E) -> GenericError<E>
Trait Implementations
sourceimpl<E: Display> ReturnableErrorShape for GenericError<E>
impl<E: Display> ReturnableErrorShape for GenericError<E>
fn convert_to_returnable<T: Serialize>(
&self,
status_code: u16
) -> TypedHttpResponse<T>
Auto Trait Implementations
impl<E> RefUnwindSafe for GenericError<E>where
E: RefUnwindSafe,
impl<E> Send for GenericError<E>where
E: Send,
impl<E> Sync for GenericError<E>where
E: Sync,
impl<E> Unpin for GenericError<E>where
E: Unpin,
impl<E> UnwindSafe for GenericError<E>where
E: UnwindSafe,
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