Open
Description
I was looking over the routing example, and a part of me was wondering if there might be some standardized macros that could help with very common filter patterns. An example:
fn main() {
let routes = routes!{
route!{
warp::index(),
||{
"Welcome!"
}
},
route!{
path!("hello"/String),
|name|{
format!("Hello {}",name)
}
}
route!{
warp::any(),
||{
"How'd you get here?"
}
}
};
warp::serve(routes)
.run(([0, 0, 0, 0], 3030));
}
routes! would .or(...)
a chain of filters
route! would .and(...)
a chain of filters and .map(...)
to the last param function
Please keep in mind i'm a Rust noob so I might be missing some capabilities of macros right now :)