Module tower

Module tower 

Source
Expand description

Tower integration - Layer and Service implementations (requires tower feature) Tower integration for error-rail.

This module provides Tower Layer and Service implementations that automatically attach error context to service errors.

§Feature Flag

Requires the tower feature:

[dependencies]
error-rail = { version = "0.8", features = ["tower"] }

§Example

use error_rail::tower::ErrorRailLayer;
use tower::ServiceBuilder;

let service = ServiceBuilder::new()
    .layer(ErrorRailLayer::new("api-gateway"))
    .service(my_service);

Structs§

ErrorRailFuture
Future returned by ErrorRailService.
ErrorRailLayer
A Tower Layer that wraps service errors in ComposableError with context.
ErrorRailService
A Tower Service that wraps errors in ComposableError with context.

Traits§

ServiceErrorExt
Extension trait for easily wrapping services with error context.