pub struct InstanceNode {
pub id: String,
pub name: Option<String>,
pub role: Option<String>,
pub component: String,
pub x: Option<Dimension>,
pub y: Option<Dimension>,
pub opacity: Option<f64>,
pub visible: Option<bool>,
pub locked: Option<bool>,
pub overrides: Vec<Override>,
pub source_span: Option<Span>,
pub unknown_props: BTreeMap<String, UnknownProperty>,
}Expand description
An instance node — a placement of a declared ComponentDef at an origin
(x, y), with an optional opacity/visible cascade and instance-local
overrides.
At compile time the instance expands to the component’s child subtree treated
as a GROUP translated by (x, y), cascading opacity/visible exactly like
a GroupNode. Every expanded descendant id is PREFIXED with the instance id
(<instance-id>/<local-id>) so multiple instances of the same component never
collide. The instance node itself emits no scene command; its expanded subtree
does. Expansion happens at COMPILE time only — the instance stays a single node
in the canonical AST so parse→format→parse round-trips.
Fields§
§id: String§name: Option<String>§role: Option<String>§component: StringThe referenced ComponentDef id.
x: Option<Dimension>Instance origin x-translation applied to the expanded subtree (default 0).
y: Option<Dimension>Instance origin y-translation applied to the expanded subtree (default 0).
opacity: Option<f64>Opacity that cascades (multiplies) into all expanded descendant alphas.
visible: Option<bool>When Some(false) the entire expanded subtree is excluded from the render.
locked: Option<bool>§overrides: Vec<Override>Instance-local overrides applied to component descendants on expansion.
source_span: Option<Span>Source declaration span, when available.
unknown_props: BTreeMap<String, UnknownProperty>Unknown properties preserved for forward-compat.
Trait Implementations§
Source§impl Clone for InstanceNode
impl Clone for InstanceNode
Source§fn clone(&self) -> InstanceNode
fn clone(&self) -> InstanceNode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for InstanceNode
impl Debug for InstanceNode
Source§impl PartialEq for InstanceNode
impl PartialEq for InstanceNode
Source§fn eq(&self, other: &InstanceNode) -> bool
fn eq(&self, other: &InstanceNode) -> bool
self and other values to be equal, and is used by ==.