ServiceErrorExt

Trait ServiceErrorExt 

Source
pub trait ServiceErrorExt<Request>: Service<Request> + Sized {
    // Provided method
    fn with_error_context<C>(self, context: C) -> ErrorRailService<Self, C>
       where C: IntoErrorContext + Clone { ... }
}
Expand description

Extension trait for easily wrapping services with error context.

Provided Methods§

Source

fn with_error_context<C>(self, context: C) -> ErrorRailService<Self, C>

Wraps this service to add error context to all errors.

§Example
use error_rail::tower::ServiceErrorExt;

let wrapped = my_service.with_error_context("database-layer");

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<S, Request> ServiceErrorExt<Request> for S
where S: Service<Request>,