Expand description
§alux-http-axum
alux-http-axum interprets an alux-http program as executable
axum routes. The interpreter chooses axum extractors for input roles, axum
responses for output kinds, and Arc for the runtime handle of a semantic context.
use alux_http::HttpProgramExt;
use alux_http_axum::AxumHandlerImpl;
let api = AxumHandlerImpl::new(App::new());
let router = api.compile_http(api.status_api::<App>()).into_axum();
axum::serve(tokio::net::TcpListener::bind("0.0.0.0:3000").await?, router).await?;Shared state reaches a handler as the semantic context from the program, not as axum state. This keeps framework types out of the specification and its domain operations.
axum uses /status/{id} for a parameter path. The same program compiled with
alux-http-poem routes /status/:id and describes it identically.
Interprets typed HTTP programs as executable axum routes.
The interpretation chooses axum’s extractors for input roles, its responses for output kinds, and
Arc for the runtime handle of a semantic context. Those choices stay inside this crate: the
program compiled here is the same value any other interpreter folds.
Structs§
- Axum
Body Input - Marks a JSON value extracted from the request body by axum.
- Axum
Bytes Output - Converts semantic results into axum raw-byte responses.
- Axum
Carrying - Carries a converted body and a header’s value until axum writes them.
- Axum
Cookie Input - Marks a value read from the cookies a caller sent.
- Axum
Empty Output - Converts a handler that returns nothing into an answer with no body.
- Axum
Endpoint - Erases a native axum service for route composition.
- Axum
File Output - Converts semantic file results into downloadable axum responses.
- Axum
File Response - Carries a file result and filename until axum creates the response.
- Axum
Form Input - Marks a form-encoded value extracted from the request body by axum.
- Axum
Handler Impl - Interprets typed HTTP programs as executable axum routes.
- Axum
Header Input - Marks a value read from the headers a caller sent.
- Axum
Header Output - Answers with a header the handler stated, beside the body it stated.
- Axum
Html Output - Converts semantic results into axum HTML responses.
- Axum
Json Output - Converts semantic results into axum JSON responses.
- Axum
Multipart Input - Marks an argument read from a body arriving as parts.
- Axum
Part - One part axum read.
- Axum
Part Content - What one part carries, as the chunks it arrives in.
- Axum
Parts - The parts axum read, as the sequence they arrive in.
- Axum
Parts Input - Marks a value extracted from the request head by axum.
- Axum
Path Input - Marks a value extracted from the request path by axum.
- Axum
Query Input - Marks a value extracted from the query string by axum.
- Axum
RawBody Input - Marks the request body taken by axum as it arrived.
- Axum
Redirect Output - Converts a semantic location into an axum redirect.
- Axum
Result Output - Answers with what a failure means when the handler failed, and with the body it states otherwise.
- Axum
Result Response - Carries either a converted body or the meaning of a failure until axum answers with it.
- Axum
Route - Carries a composable collection of native axum services.
- Axum
Route Impl - Interprets categorical route composition as native axum routing.
- Axum
Selector - Carries route-selection meaning before it is interpreted by axum.
- Axum
Server - Serves an axum route at the address its setup names.
- Axum
Status Output - Answers with the status an endpoint declared, around the body it already states.
- Axum
Status Response - Carries a converted body until axum gives it the declared status.
- Axum
Stream Output - Converts a semantic stream of chunks into an axum streamed body.
- Axum
Text Output - Converts semantic results into axum plain-text responses.
Functions§
- axum_
status - Interprets a portable status as the one axum answers with.