Struct actix_web_lab::middleware::PanicReporter
source · [−]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;
use metrics::increment_counter;
App::new()
.wrap(PanicReporter::new(|_| increment_counter!("panic")))Implementations
Trait Implementations
sourceimpl Clone for PanicReporter
impl Clone for PanicReporter
sourcefn clone(&self) -> PanicReporter
fn clone(&self) -> PanicReporter
Returns a copy of the value. Read more
1.0.0 · sourceconst fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresourceimpl Debug for PanicReporter
impl Debug for PanicReporter
sourceimpl<S, Req> Transform<S, Req> for PanicReporterwhere
S: Service<Req>,
S::Future: 'static,
impl<S, Req> Transform<S, Req> for PanicReporterwhere
S: Service<Req>,
S::Future: 'static,
type Transform = PanicReporterMiddleware<S>
type Transform = PanicReporterMiddleware<S>
The
TransformService value created by this factorytype 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.
sourcefn 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 !RefUnwindSafe for PanicReporter
impl !Send for PanicReporter
impl !Sync for PanicReporter
impl Unpin for PanicReporter
impl !UnwindSafe for PanicReporter
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