struct
Route
pub struct Route {
pub pattern: &'static str,
pub page: &'static str,
pub meta: &'static [(&'static str, &'static str)],
pub static_params: Option<fn() -> Vec<Params>>,
pub interactive: Option<bool>,
pub title: Option<fn(&Params) -> Option<String>>,
}One page of an app.
Fields
meta
pub meta: &'static [(&'static str, &'static str)]The page's metadata (its layouts', then its own, which win): title, description. Values may interpolate {params.x}.
static_params
pub static_params: Option<fn() -> Vec<Params>>The parameter sets to prerender a dynamic route with.
interactive
pub interactive: Option<bool>Overrides whether the page needs the runtime (wasm) in the browser.
title
pub title: Option<fn(&Params) -> Option<String>>The page's title from its companion (pub fn title(params)), for titles meta can't spell, such as a post's.
Methods
path_for
pub fn path_for(&self, params: &Params) -> StringThe pattern with params filled in (/blog/hello/).
meta_value
pub fn meta_value(&self, key: &str, params: &Params) -> Option<String>A metadata value with {params.x} filled in.