pub trait PanicHandler: Clone + Sync + Send + 'static {
    type Response: IntoResponse;

    // Required method
    fn get_response(&self, err: Box<dyn Any + Send + 'static>) -> Self::Response;
}
Expand description

Panics handler

Required Associated Types§

source

type Response: IntoResponse

Response type

Required Methods§

source

fn get_response(&self, err: Box<dyn Any + Send + 'static>) -> Self::Response

Call this method to create a response when a panic occurs.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl PanicHandler for ()

§

type Response = (StatusCode, &'static str)

source§

fn get_response(&self, _err: Box<dyn Any + Send + 'static>) -> Self::Response

Implementors§

source§

impl<F, R> PanicHandler for F
where F: Fn(Box<dyn Any + Send + 'static>) -> R + Send + Sync + Clone + 'static, R: IntoResponse,

§

type Response = R