luminal-router

Crates.ioluminal-router
lib.rsluminal-router
version0.0.12
sourcesrc
created_at2018-03-07 23:36:30.7445
updated_at2018-03-25 20:37:11.340627
descriptionMinimalist router for hyper.rs
homepagehttp://github.com/commandline/luminal/router
repositoryhttp://github.com/commandline/luminal
max_upload_size
id54470
size44,777
Thomas Gideon (cmdln)

documentation

README

luminal_router

A router for hyper.

Why

There are a couple of attempts to build routers for hyper. Most are not under active development. The one that is, hyper-router, is primitive, relying on regex matches.

luminal_router uses an internal radix tree for efficient dispatch. The included benchmarks demonstrate that performance is a linear function of the matching path. It doesn't introduce any additional traits or types, only aliases, so any Service implementation or function compatible with hyper::server::service_fn will work with luminal_router or bog standard hyper.

Help Wanted

The radix tree implementation seems reasonable and no doubt could stand bench marking and improvement, especially as it picks up the capability to support path parameters which will directly affect the look up time based on using path components as the edges in the underlying tree.

TODO

  • Support path parameters
  • Convert message errors to explicit types.
  • Add benchmarks.
  • Add iterator to RouteTree that consumes path tokens, yields None on first miss
  • Add examples to docs
  • Add examples to example crate
Commit count: 0

cargo fmt