Trait HandleErrorExt

Source
pub trait HandleErrorExt<B>: Service<Request<B>> + Sized {
    // Provided method
    fn handle_error<F>(self, f: F) -> HandleError<Self, F, B> { ... }
}
Expand description

Extension trait to Service for handling errors by mapping them to responses.

See module docs for more details on axum’s error handling model.

Provided Methods§

Source

fn handle_error<F>(self, f: F) -> HandleError<Self, F, B>

Apply a HandleError middleware.

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.

Implementors§

Source§

impl<B, S> HandleErrorExt<B> for S
where S: Service<Request<B>>,