๐บ trillium โ a modular async web framework
Trillium is a modular async web framework for Rust. Its key design point: there is no distinction between middleware and endpoints โ everything is a Handler. Handlers compose by nesting in tuples, running left to right and stopping at the first that halts the connection. This makes it easy to mix routing, logging, auth, compression, and any other behavior without special-casing at the framework level.
To build a Trillium app you also need a runtime adapter: trillium-tokio, trillium-smol, or trillium-async-std.
Example
use Conn;
// Any async fn(Conn) -> Conn is a Handler:
async
// Handlers compose left-to-right in a tuple.
// The first handler to call conn.halt() stops the chain.
let app = ;
// run with your chosen runtime adapter:
// trillium_tokio::run(app);
Safety
This crate uses #![forbid(unsafe_code)].