Expand description
§alux-http-text
alux-http-text interprets an alux-http program as a readable
description of its routes and types. It executes no handler; it lists the methods, paths, input
roles, arguments, results, and output conversions declared by the program.
ⓘ
use alux_http::HttpProgramExt;
use alux_http_text::TextHandlerImpl;
let api = TextHandlerImpl;
let routes = api.compile_http(api.status_api::<App>());
assert_eq!(routes.labels(), ["GET /status"]);
println!("{}", routes.lines().join("\n"));The same program value can be compiled by any other interpreter, such as
alux-http-poem, without restating its routes.
Interprets typed HTTP programs as readable route and type descriptions.
The text interpretation executes no handler. It records the selectors, extractor roles, argument product, handler result, and output conversion each endpoint denotes, which makes it the neutral witness that an HTTP program means a surface rather than a framework callback.
Structs§
- Auth
Role - Identifies authentication extraction in text descriptions.
- Body
Role - Identifies request-body extraction in text descriptions.
- Context
Role - Identifies request-context extraction in text descriptions.
- Cookie
Role - Identifies cookie extraction in text descriptions.
- Form
Role - Identifies form-encoded request-body extraction in text descriptions.
- Header
Role - Identifies header extraction in text descriptions.
- Multipart
Role - Identifies extraction from a body arriving as parts, in text descriptions.
- Path
Role - Identifies path extraction in text descriptions.
- Query
Role - Identifies query extraction in text descriptions.
- RawBody
Role - Identifies extraction of the request body as it arrived, in text descriptions.
- Text
Bytes Output - Interprets raw-byte output selection in text descriptions.
- Text
Empty Output - Interprets empty output selection in text descriptions.
- Text
Endpoint - Carries interpreted endpoint type information.
- Text
File Output - Interprets streamed-file output selection in text descriptions.
- Text
Handler Impl - Interprets typed APIs as text descriptions.
- Text
Header Output - Interprets a header an answer carries, in text descriptions.
- Text
Html Output - Interprets HTML output selection in text descriptions.
- Text
Input Role - Identifies an HTTP input role in text output.
- Text
Json Output - Interprets JSON output selection in text descriptions.
- Text
Redirect Output - Interprets redirect output selection in text descriptions.
- Text
Result Output - Interprets a failing handler in text descriptions.
- Text
Route - Carries an interpreted route composition.
- Text
Selector - Carries interpreted selector data.
- Text
Status Output - Interprets a declared status in text descriptions.
- Text
Stream Output - Interprets streamed output selection in text descriptions.
- Text
Text Output - Interprets plain-text output selection in text descriptions.