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§
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 PanicReporterwhere
S: Service<Req>,
S::Future: 'static,
impl<S, Req> Transform<S, Req> for PanicReporterwhere S: Service<Req>, S::Future: 'static,
§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 !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