Skip to main content

segment

Attribute Macro segment 

Source
#[segment]
Expand description

Writes type Installs = (); and the install that goes with it, for a page or layout that installs nothing.

Only that. Declaring what a segment installs is what makes the declaration an obligation of the body; declaring that it installs nothing is ceremony, and stable Rust has no conditional default body to remove it.

ⓘ
#[segment]
impl Page for Splash {
    type Params = ();
    fn view(cx: &mut PageCx<'_>) { .. }
}