pub struct StdError(pub Box<dyn Error + Send + Sync>);Expand description
new type for Box<dyn std::error::Error + Send + Sync>. produce minimal
“500 InternalServerError” response and forward formatting, error handling
to inner type.
In other words it’s an error type keep it’s original formatting and error
handling methods without a specific Service impl for generating custom
http response.
Tuple Fields§
§0: Box<dyn Error + Send + Sync>Trait Implementations§
source§impl Error for StdError
impl Error for StdError
source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
source§fn provide<'a>(&'a self, request: &mut Request<'a>)
fn provide<'a>(&'a self, request: &mut Request<'a>)
🔬This is a nightly-only experimental API. (
error_generic_member_access)Provides type based access to context intended for error reports. 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<'r, C, B> Service<WebContext<'r, C, B>> for StdError
impl<'r, C, B> Service<WebContext<'r, C, B>> for StdError
§type Response = Response<ResponseBody>
type Response = Response<ResponseBody>
The Ok part of output future.
§type Error = Infallible
type Error = Infallible
The Err part of output future.
async fn call( &self, ctx: WebContext<'r, C, B> ) -> Result<Self::Response, Self::Error>
Auto Trait Implementations§
impl !RefUnwindSafe for StdError
impl Send for StdError
impl Sync for StdError
impl Unpin for StdError
impl !UnwindSafe for StdError
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<S, Arg> ServiceExt<Arg> for Swhere
S: Service<Arg>,
impl<S, Arg> ServiceExt<Arg> for Swhere
S: Service<Arg>,
source§fn enclosed<T>(self, build: T) -> Pipeline<Self, T, BuildEnclosed>
fn enclosed<T>(self, build: T) -> Pipeline<Self, T, BuildEnclosed>
Enclose Self with given
T as Service<<Self as Service<_>>::Response>>. In other word T
would take Self’s Service::Response type as it’s generic argument of Service<_> impl.source§fn enclosed_fn<T, Req>(self, func: T) -> Pipeline<Self, T, BuildEnclosedFn>
fn enclosed_fn<T, Req>(self, func: T) -> Pipeline<Self, T, BuildEnclosedFn>
Function version of Self::enclosed method.
source§fn map<F, Res, ResMap>(self, mapper: F) -> Pipeline<Self, F, BuildMap>
fn map<F, Res, ResMap>(self, mapper: F) -> Pipeline<Self, F, BuildMap>
Mutate
<<Self::Response as Service<Req>>::Future as Future>::Output type with given
closure.