Skip to main content

SpawnIntoWorld

Trait SpawnIntoWorld 

Source
pub trait SpawnIntoWorld {
    // Required method
    fn spawn_into(&self, world: &mut World) -> Entity;
}
Expand description

Spawn an IR tree into a main world. Defined as a local extension trait because LayoutIR now lives in lumen-ir and an inherent impl on a foreign type isn’t allowed; the spawn logic (which drives lumenc’s ECS walker) stays here.

Required Methods§

Source

fn spawn_into(&self, world: &mut World) -> Entity

Spawn the IR tree into the given main world. Returns the root entity.

Implementations on Foreign Types§

Source§

impl SpawnIntoWorld for CompiledApp

A compiled app spawns its tree and the fragments that tree names.

The tree alone is not the whole app: a <template> body and an lmn! block travel beside it in the artifact, and a script instantiates one by key while the app runs. Taking both from the artifact in one call is what keeps a page, a server render and a window building the same subtree, rather than each remembering to install the table on its own.

Source§

fn spawn_into(&self, world: &mut World) -> Entity

Source§

impl SpawnIntoWorld for LayoutIR

Source§

fn spawn_into(&self, world: &mut World) -> Entity

Implementors§