alux-http
alux-http describes typed HTTP programs independently of a web framework.
The crate is a specification. It carries no interpreter and depends only on
alux-ext: an HTTP surface is described here as first-order syntax plus
the capability algebras an interpreter must witness. Domain specifications provide their own algebras
and compose first-order operations into routes.
use ;
use ;
use Future;
/// A downstream specification owns its primitive domain meaning.
/// Derived operations become first-order values that preserve their argument names.
/// The route program is declared before any framework is chosen.
;
// The same program is constructible directly, without the convenience macro and without an
// interpreter, because a route program is an ordinary value.
let builder = HttpProgramBuilder;
let program = builder
.routes
.get
.into_program;
let _nested = builder.routes.nest.into_program;
// Argument names and order survive from the authored method into the program.
assert_eq!;
A program declared this way compiles through any crate that witnesses its algebras:
alux-http-textdescribes the surface as documentation or metadata.alux-http-poemcompiles the same program into executable Poem routes.