pub struct PageHead { /* private fields */ }Expand description
What a contributed page shows above its body: the title, a way back when the page sits under another, and the controls that act on the page as a whole (export, a menu of operations), which render beside the title.
ⓘ
let head = PageHead::new(Text::dynamic(theme.name))
.back(t!("Themes"), ctx.url(""))
.actions(Markup::from_template(&ActionsTemplate { .. })?);
shell.page_with(head, body)Implementations§
Source§impl PageHead
impl PageHead
pub fn new(title: impl Into<Text>) -> Self
Sourcepub fn assets(self, keys: &[&'static str]) -> Self
pub fn assets(self, keys: &[&'static str]) -> Self
Widget assets this page needs beyond the core script and stylesheet,
by registry key (for example CODE_EDITOR_ASSETS), emitted in the
head after laterite.js in the order given.
Sourcepub fn back(self, label: impl Into<Text>, href: impl Into<String>) -> Self
pub fn back(self, label: impl Into<Text>, href: impl Into<String>) -> Self
The page this one sits under, linked above the title.
Auto Trait Implementations§
impl Freeze for PageHead
impl RefUnwindSafe for PageHead
impl Send for PageHead
impl Sync for PageHead
impl Unpin for PageHead
impl UnsafeUnpin for PageHead
impl UnwindSafe for PageHead
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more