[][src]Macro subscript::url_parser

macro_rules! url_parser {
    ($($x:tt)*) => { ... };
}

SPA Application Routing/Navigation

let url_parser: UrlParser<Page> = url_parser!{
    [] => {
        Page::Homepage
    }
    ["content"] => {
        Page::Content
    }
    ["input"] => {
        Page::Input
    }
    ["insight"] => {
        Page::Insight(InsightPage::Overview)
    }
    ["insight", "health"] => {
        Page::Insight(InsightPage::Health)
    }
    ["insight", "traffic"] => {
        Page::Insight(InsightPage::Traffic)
    }
    ["insight", "bandwidth"] => {
        Page::Insight(InsightPage::Bandwidth)
    }
    ["insight", "cache"] => {
        Page::Insight(InsightPage::Cache)
    }
    ["insight", "storage"] => {
        Page::Insight(InsightPage::Storage)
    }
    ["account"] => {
        Page::Account(AccountPage::default())
    }
    ["account", "billing"] => {
        Page::Account(AccountPage::Billing)
    }
    ["account", "password"] => {
        Page::Account(AccountPage::Password)
    }
    ["account", "users"] => {
        Page::Account(AccountPage::Users(UsersPage::Index))
    }
    ["account", "users", "add-user"] => {
        Page::Account(AccountPage::Users(UsersPage::AddUser))
    }
    ["login"] => {
        Page::Login(LoginPage::Login)
    }
    ["signup"] => {
        Page::Login(LoginPage::Signup)
    }
    _ => {
        Page::NotFound
    }
};