An async HTTP server library. Currently in alpha.
The goal is to be low-level and small enough to work with different async runtimes and not dictate user architecture, while having enough convenience functions to still easily build a REST api.
Also, this:
rust
async fn handler(req:Request, resp_wtr: ResponseWriter) -> Result<ResponseWritten, Error> {
let done = resp_wtr.send(Response::empty())?;
// Do things here after resp is written
Ok(done)
}
instead of:
rust
async fn handler(req:Request) -> Result<Response, Error> {
Ok(Response::empty())
}
futures::{AsyncRead, AsyncWrite}
.Correct handling of the HTTP protocol is a priority.
Upcoming features:
- Router. Service abstraction?
- Convenience functions for building Responses.
- Json feature.
- Client.
- Lots of examples.
- static file serving? (have to investigate something like blocking
).
Long term: - HTTP/2
Especially to async-h1, whose eye for structure and design I appreciate, and whose code base tophat is built from. And to hyper, whose devotion to performance and correctness is inspiring, and whose basic http libraries tophat has incorporated.
Licensed under either of
at your option.