Macro router::url_for [] [src]

macro_rules! url_for {
    ($request:expr, $route_id:expr $(,$key:expr => $value:expr)* $(,)*) => { ... };
}

Generate a URL based off of the requested one.

Be careful when using this code, it's not being tested!
url_for!(request, "foo",
         "query" => "test",
         "extraparam" => "foo")

Is equivalent to:

Be careful when using this code, it's not being tested!
router::url_for(request, "foo", {
    let mut rv = ::std::collections::HashMap::new();
    rv.insert("query".to_owned(), "test".to_owned());
    rv.insert("extraparam".to_owned(), "foo".to_owned());
    rv
})