actix-chain

Crates.ioactix-chain
lib.rsactix-chain
version0.1.0
created_at2025-07-23 02:21:21.762889+00
updated_at2025-07-23 02:21:21.762889+00
descriptionActix-Web service chaining service.
homepage
repositoryhttps://github.com/imgurbot12/actix-services/tree/master/actix-chain
max_upload_size
id1764295
size63,860
Andrew Scott (imgurbot12)

documentation

https://docs.rs/actix-chain/

README

actix-chain

crates.io Documentation Version License
dependency status Download

Actix-Web service chaining service.

Provides a simple non-blocking service for chaining together other arbitrary services.

Examples

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)))
);
Commit count: 0

cargo fmt