Skip to main content

Crate alux_http_text

Crate alux_http_text 

Source
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§

AuthRole
Identifies authentication extraction in text descriptions.
BodyRole
Identifies request-body extraction in text descriptions.
ContextRole
Identifies request-context extraction in text descriptions.
CookieRole
Identifies cookie extraction in text descriptions.
FormRole
Identifies form-encoded request-body extraction in text descriptions.
HeaderRole
Identifies header extraction in text descriptions.
MultipartRole
Identifies extraction from a body arriving as parts, in text descriptions.
PathRole
Identifies path extraction in text descriptions.
QueryRole
Identifies query extraction in text descriptions.
RawBodyRole
Identifies extraction of the request body as it arrived, in text descriptions.
TextBytesOutput
Interprets raw-byte output selection in text descriptions.
TextEmptyOutput
Interprets empty output selection in text descriptions.
TextEndpoint
Carries interpreted endpoint type information.
TextFileOutput
Interprets streamed-file output selection in text descriptions.
TextHandlerImpl
Interprets typed APIs as text descriptions.
TextHeaderOutput
Interprets a header an answer carries, in text descriptions.
TextHtmlOutput
Interprets HTML output selection in text descriptions.
TextInputRole
Identifies an HTTP input role in text output.
TextJsonOutput
Interprets JSON output selection in text descriptions.
TextRedirectOutput
Interprets redirect output selection in text descriptions.
TextResultOutput
Interprets a failing handler in text descriptions.
TextRoute
Carries an interpreted route composition.
TextSelector
Carries interpreted selector data.
TextStatusOutput
Interprets a declared status in text descriptions.
TextStreamOutput
Interprets streamed output selection in text descriptions.
TextTextOutput
Interprets plain-text output selection in text descriptions.