Skip to content

struct

Routes

pub struct Routes {
    pub routes: &'static [Route],
    pub template: &'static str,
    pub mode: Mode,
    pub base: &'static str,
}

An app's routes, as generated from app/.

Fields

routes

pub routes: &'static [Route]

Numbered depth-first through the layout tree.

template

pub template: &'static str

The root template: layouts around a ladder of if route <= n.

mode

pub mode: Mode

How pages are served: a single-page app, or one file per page.

base

pub base: &'static str

Where the app is served (/, /blog/): its patterns start with it, and its files are there.

Methods

href

pub fn href(&self, path: &str) -> String

path under the app's base: /tag/rust/ → /blog/tag/rust/.

Trait implementations