luminal-handler

Crates.ioluminal-handler
lib.rsluminal-handler
version0.0.5
sourcesrc
created_at2018-03-12 20:34:54.976709
updated_at2018-03-25 20:18:29.284876
descriptionSlightly more convenient API on top of hyper::server::Service
homepagehttp://github.com/commandline/luminal/router
repositoryhttp://github.com/commandline/luminal
max_upload_size
id55222
size7,952
Thomas Gideon (cmdln)

documentation

README

luminal-handler

A crate to provide a trait to implement and a function to call to lift non-future aware request handling into hyper.

Why

hyper::server::Service isn't a super forgiving API. It exposes the plumbing of futures pretty directly and makes error handling unclear. It is hoped that this create provides an easier API without sacrificing much, if any performance. In particular, the trait IntoResponse is introduced to help caller's use their own error kinds, layering in what is needed to convert those errors into valid hyper::server::Response instances.

TODO

  • Add handler_fn to match hyper's service_fn
  • Improve error handling
    • Support status code and response body for error
  • Add tests
  • Figure out how to pass additional information with requests cleanly
    • A preliminary enum now exists
    • Usage is likely to be driven by have luminal-pathparam and luminal-middleware evolve.
  • Add examples to docs
  • Add examples to example crate
Commit count: 0

cargo fmt