🔌 trillium-api — extractor-based API handler
Extractor-based API layer for Trillium. Wraps an async function into a Handler: the function receives a &mut Conn and a typed value extracted from the request (deserialized body, shared state, route params, etc.) and returns any type that implements Handler.
Example
use ;
use Conn;
/// No input, JSON response.
async
/// Deserialize a JSON body and echo it back.
async
let app = ;
// run with your chosen runtime adapter, e.g.:
// trillium_tokio::run(app);
Safety
This crate uses #![forbid(unsafe_code)].