pub struct ComponentDef {
pub id: String,
pub children: Vec<Node>,
pub source_span: Option<Span>,
}Expand description
A reusable component definition: a named child-node subtree declared once
(in the document-level components block) and instanced into multiple places
via Node::Instance.
Declared as component id="logo.block" { <any child nodes> }. The component’s
child node ids are LOCAL to the component: they are validated for uniqueness
only WITHIN the component, not globally, and they are prefixed with the
instance id when an instance is expanded at compile time. The component id
itself participates in the global id-uniqueness set.
Fields§
§id: String§children: Vec<Node>The component’s child nodes in source order (the reusable subtree).
source_span: Option<Span>Source declaration span, when available.
Trait Implementations§
Source§impl Clone for ComponentDef
impl Clone for ComponentDef
Source§fn clone(&self) -> ComponentDef
fn clone(&self) -> ComponentDef
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ComponentDef
impl Debug for ComponentDef
Source§impl PartialEq for ComponentDef
impl PartialEq for ComponentDef
Source§fn eq(&self, other: &ComponentDef) -> bool
fn eq(&self, other: &ComponentDef) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ComponentDef
Auto Trait Implementations§
impl Freeze for ComponentDef
impl RefUnwindSafe for ComponentDef
impl Send for ComponentDef
impl Sync for ComponentDef
impl Unpin for ComponentDef
impl UnsafeUnpin for ComponentDef
impl UnwindSafe for ComponentDef
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