alux-http-hyper
alux-http-hyper serves an alux-http surface over
hyper, with no web framework.
alux-http-direct answers a request with values but carries no
transport. This crate connects it to hyper: it reads a hyper request into a DirectRequest, passes
it to the surface, and writes the answer back as a hyper response.
use HttpProgramExt;
use DirectHandlerImpl;
use HyperRoute;
use ;
use Builder;
let api = new;
let served = new;
let listener = bind.await?;
loop
The crate states a [hyper::service::Service] and stops there. Which runtime listens, and how
connections are driven, stays yours, so this names no runtime: tokio and hyper-util above are
the caller's choice, not this crate's dependencies.
A body the surface produces over time is served as one, so .stream() reaches a caller a chunk at a
time rather than being collected first.
Two kinds of request cannot reach a handler at all, and both get a response instead of killing the
connection. HttpMethod names nine methods, so a request using anything else, such as the
WebDAV PROPFIND, is answered 405 Method Not Allowed.
A request whose body cannot be read to the end is
answered 400 Bad Request.