Expand description
Rouste is a generic and declarative way of writing a URL based router with insane Rust macros.
This can be achieved with the help of two macros: route!
and route_with!
. The former generate
a function that tries to match the URL from a pattern, capture data from it and execute a
function that computes the response for this route. The latter combines several routes in a
router.
Rouste is generic in the sense that a every route of a router can capture different values from the URL and that a router can return any type of value.
Usage:
#[macro_use] extern crate rouste;
use rouste::utils::*;
Modules§
Macros§
- clean_
and_ callback - Execute a callback after removing unnamed segments.
- route
- Build a route from a pattern and a callback.
- route_
with - Compose a router given an URI and a list of routes.