Skip to main content

LayoutIR

Struct LayoutIR 

Source
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: Element

The single root element.

§script_source: String

Concatenated 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: SourceMap

Where 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.

§menubar: Option<MenuBarSpec>

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 Clone for LayoutIR

Source§

fn clone(&self) -> LayoutIR

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for LayoutIR

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for LayoutIR

Source§

fn default() -> LayoutIR

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for LayoutIR

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for LayoutIR

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FromTemplate for T
where T: Clone + Default + Unpin,

§

type Template = T

The [Template] for this type.
§

impl<T> FromWorld for T
where T: Default,

§

fn from_world(_world: &mut World) -> T

Creates Self using default().

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> IntoResult<T> for T

§

fn into_result(self) -> Result<T, RunSystemError>

Converts this type into the system output type.
§

impl<T> Template for T
where T: Clone + Default + Unpin,

§

type Output = T

The type of value produced by this [Template].
§

fn build_template( &self, _context: &mut TemplateContext<'_, '_>, ) -> Result<<T as Template>::Output, BevyError>

Uses this template and the given entity context to produce a [Template::Output].
§

fn clone_template(&self) -> T

Clones this template. See Clone.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<T> ConditionalSend for T
where T: Send,

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,