Crates.io | luminal-router |
lib.rs | luminal-router |
version | 0.0.12 |
source | src |
created_at | 2018-03-07 23:36:30.7445 |
updated_at | 2018-03-25 20:37:11.340627 |
description | Minimalist router for hyper.rs |
homepage | http://github.com/commandline/luminal/router |
repository | http://github.com/commandline/luminal |
max_upload_size | |
id | 54470 |
size | 44,777 |
A router for hyper.
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.
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.