Expand description
§alux-http-poem
alux-http-poem interprets an alux-http program as executable
Poem routes. The interpreter chooses Poem extractors for input roles, Poem
responses for output kinds, and Arc for the runtime handle of a semantic context.
ⓘ
use alux_http::HttpProgramExt;
use alux_http_poem::PoemHandlerImpl;
let api = PoemHandlerImpl::new(App::new());
let route = api.compile_http(api.status_api::<App>()).into_poem();
poem::Server::new(poem::listener::TcpListener::bind("0.0.0.0:3000")).run(route).await?;Poem bodies, headers, errors, and endpoint erasure stay inside this crate. Compiling the same program
with alux-http-text observes the identical ordered surface.
Interprets typed HTTP programs as executable Poem routes.
The interpretation chooses Poem’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§
- Poem
Body Input - Marks a JSON value extracted from the request body by Poem.
- Poem
Bytes Output - Converts semantic results into Poem raw-byte responses.
- Poem
Carrying - Carries a converted body and a header’s value until Poem writes them.
- Poem
Cookie Input - Marks a value read from the cookies a caller sent.
- Poem
Empty Output - Converts a handler that returns nothing into an answer with no body.
- Poem
Endpoint - Erases a native Poem endpoint for route composition.
- Poem
File Output - Converts semantic file results into downloadable Poem responses.
- Poem
File Response - Carries a file result and filename until Poem creates the response.
- Poem
Form Input - Marks a form-encoded value extracted from the request body by Poem.
- Poem
Handler Impl - Interprets typed HTTP programs as executable Poem routes.
- Poem
Header Input - Marks a value read from the headers a caller sent.
- Poem
Header Output - Answers with a header the handler stated, beside the body it stated.
- Poem
Html Output - Converts semantic results into Poem HTML responses.
- Poem
Json Output - Converts semantic results into Poem JSON responses.
- Poem
Multipart Input - Marks an argument read from a body arriving as parts.
- Poem
Open - Carries an open Poem server that is accepting requests.
- Poem
Part - One part Poem read.
- Poem
Part Content - What one part carries, as the chunks it arrives in.
- Poem
Parts - The parts Poem read, as the sequence they arrive in.
- Poem
Path Input - Marks a value extracted from the request path by Poem.
- Poem
Query Input - Marks a value extracted from the query string by Poem.
- Poem
Redirect Output - Converts a semantic location into a Poem redirect.
- Poem
Request Input - Marks a value extracted through Poem’s general request extractor.
- Poem
Result Output - Answers with what a failure means when the handler failed, and with the body it states otherwise.
- Poem
Result Response - Carries either a converted body or the meaning of a failure until Poem answers with it.
- Poem
Route - Carries a composable collection of native Poem endpoints.
- Poem
Route Impl - Interprets categorical route composition as native Poem routing.
- Poem
Selector - Carries route-selection meaning before it is interpreted by Poem.
- Poem
Server - Serves a Poem route at the address its setup names.
- Poem
Status Output - Answers with the status an endpoint declared, around the body it already states.
- Poem
Status Response - Carries a converted body until Poem gives it the declared status.
- Poem
Stream Output - Converts a semantic stream of chunks into a Poem streamed body.
- Poem
Text Output - Converts semantic results into Poem plain-text responses.
Functions§
- poem_
status - Interprets a portable status as the one Poem answers with.