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;
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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