pub struct PanicReporter { /* private fields */ }Expand description
A middleware that triggers a callback when the worker is panicking.
Mostly useful for logging or metrics publishing. The callback received the object with which panic was originally invoked to allow down-casting.
§Examples
use actix_web_lab::middleware::PanicReporter;
App::new().wrap(PanicReporter::new(|_| metrics::increment_counter!("panic")))Implementations§
Trait Implementations§
Source§impl Clone for PanicReporter
impl Clone for PanicReporter
Source§fn clone(&self) -> PanicReporter
fn clone(&self) -> PanicReporter
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PanicReporter
impl Debug for PanicReporter
Source§impl<S, Req> Transform<S, Req> for PanicReporter
impl<S, Req> Transform<S, Req> for PanicReporter
Source§type Transform = PanicReporterMiddleware<S>
type Transform = PanicReporterMiddleware<S>
The
TransformService value created by this factorySource§type Future = Ready<Result<<PanicReporter as Transform<S, Req>>::Transform, <PanicReporter as Transform<S, Req>>::InitError>>
type Future = Ready<Result<<PanicReporter as Transform<S, Req>>::Transform, <PanicReporter as Transform<S, Req>>::InitError>>
The future response value.
Source§fn new_transform(&self, service: S) -> Self::Future
fn new_transform(&self, service: S) -> Self::Future
Creates and returns a new Transform component, asynchronously
Auto Trait Implementations§
impl Freeze for PanicReporter
impl !RefUnwindSafe for PanicReporter
impl !Send for PanicReporter
impl !Sync for PanicReporter
impl Unpin for PanicReporter
impl !UnwindSafe for PanicReporter
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 more