1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
//! Actix-Web service chaining service.
//!
//! Provides a simple non-blocking service for chaining together other arbitrary services.
//!
//! # Example
//!
//! ```
//! use actix_web::{App, HttpRequest, HttpResponse, Responder, web};
//! use actix_chain::{Chain, Link};
//!
//! async fn might_fail(req: HttpRequest) -> impl Responder {
//! if !req.headers().contains_key("Required-Header") {
//! return HttpResponse::NotFound().body("Request Failed");
//! }
//! HttpResponse::Ok().body("It worked!")
//! }
//!
//! async fn default() -> &'static str {
//! "First link failed!"
//! }
//!
//! App::new().service(
//! Chain::default()
//! .link(Link::new(web::get().to(might_fail)))
//! .link(Link::new(web::get().to(default)))
//! );
//! ```
pub use Chain;
pub use Link;
pub use ChainService;