Skip to main content

ErrorResponder

Trait ErrorResponder 

Source
pub trait ErrorResponder: Send + Sync {
    // Required method
    fn error_response<'a>(
        &'a self,
        status: StatusCode,
    ) -> impl Future<Output = Response<BoxBody<Bytes, Error>>> + Send + 'a;
}
Expand description

Generates HTTP error responses for proxy failures.

Implement this trait to customize error pages shown to clients when proxy operations fail.

Required Methods§

Source

fn error_response<'a>( &'a self, status: StatusCode, ) -> impl Future<Output = Response<BoxBody<Bytes, Error>>> + Send + 'a

Generates an HTTP response for the given error status code.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<DYNOSAUR> ErrorResponder for &DYNOSAUR
where DYNOSAUR: ?Sized + ErrorResponder, Self: Send + Sync,

Source§

fn error_response<'a>( &'a self, status: StatusCode, ) -> impl Future<Output = Response<BoxBody<Bytes, Error>>> + Send

Source§

impl<DYNOSAUR> ErrorResponder for &mut DYNOSAUR
where DYNOSAUR: ?Sized + ErrorResponder, Self: Send + Sync,

Source§

fn error_response<'a>( &'a self, status: StatusCode, ) -> impl Future<Output = Response<BoxBody<Bytes, Error>>> + Send

Source§

impl<DYNOSAUR> ErrorResponder for Box<DYNOSAUR>
where DYNOSAUR: ?Sized + ErrorResponder, Self: Send + Sync,

Source§

fn error_response<'a>( &'a self, status: StatusCode, ) -> impl Future<Output = Response<BoxBody<Bytes, Error>>> + Send

Implementors§