pub struct LayoutIR {
pub root: Element,
pub script_source: String,
pub script_map: SourceMap,
pub external_scripts: Vec<String>,
pub skin: Option<String>,
pub frameless: bool,
pub menubar: Option<MenuBarSpec>,
pub combined_stylesheet: Option<Stylesheet>,
pub lint_findings: Vec<LintFinding>,
pub included_files: Vec<PathBuf>,
}Expand description
Top of the IR. Single root element; multi-rooted markup is illegal.
Fields§
§root: ElementThe single root element.
script_source: StringConcatenated body text of every inline <script> tag found in
the markup, in source order, separated by \n. Empty if none.
Use <script src="foo.cdl"/> instead when the script contains
characters that confuse the XML parser (<, <=, &) - those
references land in [external_scripts].
script_map: SourceMapWhere each inline block in Self::script_source was written: its
markup file and the line its text starts on, so an error in it names
that line.
external_scripts: Vec<String>Paths from every <script src="..."/> reference, in source
order. The runtime (lumenc::run::load_ir) resolves them
relative to the app directory and concatenates with
script_source before handing the combined source to the
scripting host.
skin: Option<String>Opt-in skin requested by the root element via <root skin="...">.
None means the bare framework - no default styling, fully
honouring the SDD “no opinionated default theme” principle. When
Some("default") (the only recognised value today), the runtime
prepends an embedded lumen-skin-default stylesheet before
parsing the user’s main.css.
frameless: bool<root frameless="true"> - suppress OS window chrome (title
bar, borders, close/min/max buttons). The window backend reads
this once at startup to set WindowAttributes::decorations(false).
Custom title bars are the app’s responsibility.
Native menu bar, collected from the top-level <menubar>
element (if any) and stripped from the layout tree. None =
no menu bar. Each entry maps to a muda::Submenu /
MenuItem / PredefinedMenuItem::separator.
combined_stylesheet: Option<Stylesheet>Concatenated skin + user CSS, kept around so the for-block
reconciler can re-apply matching rules to virtualized template
instances after {kind}/{level} etc. placeholders have
been substituted into class names at runtime. Without this,
<label class="md-h{level}"> never picks up .md-h1 because
the parse-time apply pass only saw the literal placeholder.
lint_findings: Vec<LintFinding>Parse-time lint findings. Populated by the markup walker for
problems that don’t invalidate the IR: {name} bare
interpolation, a boolean attribute with an off-list value, an
attribute nothing reads. The runtime / IR consumers ignore this;
every compile path (lumenc check, run, build) prints it to
stderr at the finding’s own severity, and lumenc lint --signals
folds it into the finding stream.
included_files: Vec<PathBuf>Normalized paths of every .lmn file pulled in via
<include src="..."/> (transitively, in resolution order). Empty
when the markup used no includes or was parsed without a file
loader. The runtime (lumenc::run) adds these to the hot-reload
watch set so editing an included file re-triggers a reload, exactly
like [external_scripts].
Trait Implementations§
Source§impl<'de> Deserialize<'de> for LayoutIR
impl<'de> Deserialize<'de> for LayoutIR
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for LayoutIR
impl RefUnwindSafe for LayoutIR
impl Send for LayoutIR
impl Sync for LayoutIR
impl Unpin for LayoutIR
impl UnsafeUnpin for LayoutIR
impl UnwindSafe for LayoutIR
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FromTemplate for T
impl<T> FromTemplate for T
§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Creates Self using default().
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
§fn into_result(self) -> Result<T, RunSystemError>
fn into_result(self) -> Result<T, RunSystemError>
§impl<T> Template for T
impl<T> Template for T
§fn build_template(
&self,
_context: &mut TemplateContext<'_, '_>,
) -> Result<<T as Template>::Output, BevyError>
fn build_template( &self, _context: &mut TemplateContext<'_, '_>, ) -> Result<<T as Template>::Output, BevyError>
entity context to produce a [Template::Output].§fn clone_template(&self) -> T
fn clone_template(&self) -> T
Clone.