pub struct LayoutContext<'a> {
pub title: &'a str,
pub content: &'a str,
pub head: &'a str,
pub body_class: &'a str,
pub view_json: &'a str,
pub data_json: &'a str,
pub scripts: &'a str,
}Expand description
Context passed to layout render functions.
Contains all data a layout needs to produce a complete HTML page: the rendered component HTML, page metadata, and serialized view/data for potential frontend hydration.
Fields§
§title: &'a strPage title for the <title> element.
content: &'a strRendered component HTML fragment (output of render_to_html).
head: &'a strAdditional <head> content (Tailwind CDN link, custom styles).
body_class: &'a strCSS classes for the <body> element.
view_json: &'a strSerialized view JSON for the data-view attribute.
data_json: &'a strSerialized data JSON for the data-props attribute.
scripts: &'a strJS assets and init scripts for plugins, injected before closing body tag.
Auto Trait Implementations§
impl<'a> Freeze for LayoutContext<'a>
impl<'a> RefUnwindSafe for LayoutContext<'a>
impl<'a> Send for LayoutContext<'a>
impl<'a> Sync for LayoutContext<'a>
impl<'a> Unpin for LayoutContext<'a>
impl<'a> UnsafeUnpin for LayoutContext<'a>
impl<'a> UnwindSafe for LayoutContext<'a>
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