pub enum NodeBlueprint {
Element {
tag: Tag,
classes: ClassList,
attributes: Vec<Attribute>,
children: Vec<NodeBlueprint>,
},
Text(String),
DynamicText(Rc<dyn Fn() -> String>),
Fragment(Vec<NodeBlueprint>),
Empty,
}Expand description
Core reactive blueprint tree representation.
Variants§
Implementations§
Source§impl NodeBlueprint
impl NodeBlueprint
pub fn element( tag: Tag, classes: impl Into<ClassList>, attributes: Vec<Attribute>, children: Vec<NodeBlueprint>, ) -> NodeBlueprint
pub fn element_simple( tag: Tag, classes: impl Into<ClassList>, children: Vec<NodeBlueprint>, ) -> NodeBlueprint
pub fn text(content: impl Into<String>) -> NodeBlueprint
pub fn dynamic_text(f: impl Fn() -> String + 'static) -> NodeBlueprint
pub fn fragment(children: Vec<NodeBlueprint>) -> NodeBlueprint
pub fn empty() -> NodeBlueprint
Sourcepub fn entity_id(&self) -> Option<EntityId>
pub fn entity_id(&self) -> Option<EntityId>
Returns the EntityId assigned to this blueprint element if present.
Sourcepub fn with_entity_id(self, entity_id: EntityId) -> NodeBlueprint
pub fn with_entity_id(self, entity_id: EntityId) -> NodeBlueprint
Assigns or overrides the EntityId for an Element node blueprint.
Sourcepub fn set_entity_id(&mut self, entity_id: EntityId)
pub fn set_entity_id(&mut self, entity_id: EntityId)
Mutably assigns or overrides the EntityId for an Element node blueprint.
Sourcepub fn ensure_entity_ids(&mut self)
pub fn ensure_entity_ids(&mut self)
Iteratively ensures all Element nodes in this blueprint tree have a valid EntityId without consuming call-stack frames on deeply nested trees.
Sourcepub fn find_by_entity_id(&self, target_id: EntityId) -> Option<&NodeBlueprint>
pub fn find_by_entity_id(&self, target_id: EntityId) -> Option<&NodeBlueprint>
Iteratively locates an element blueprint node by its EntityId (O(1) call stack).
Sourcepub fn find_by_entity_id_mut(
&mut self,
target_id: EntityId,
) -> Option<&mut NodeBlueprint>
pub fn find_by_entity_id_mut( &mut self, target_id: EntityId, ) -> Option<&mut NodeBlueprint>
Iteratively locates a mutable element blueprint node by its EntityId (O(1) call stack).
Sourcepub fn dom_uid(&self) -> Option<u64>
pub fn dom_uid(&self) -> Option<u64>
Returns the DOM node UID from a data-strata-node-uid attribute if present.
Sourcepub fn find_by_dom_uid(&self, target_uid: u64) -> Option<&NodeBlueprint>
pub fn find_by_dom_uid(&self, target_uid: u64) -> Option<&NodeBlueprint>
Iteratively locates an element blueprint node by its DOM node UID (O(1) call stack).
Sourcepub fn find_by_dom_uid_mut(
&mut self,
target_uid: u64,
) -> Option<&mut NodeBlueprint>
pub fn find_by_dom_uid_mut( &mut self, target_uid: u64, ) -> Option<&mut NodeBlueprint>
Iteratively locates a mutable element blueprint node by its DOM node UID (O(1) call stack).
Sourcepub fn find_path_by_dom_uid(&self, target_uid: u64) -> Option<Vec<usize>>
pub fn find_path_by_dom_uid(&self, target_uid: u64) -> Option<Vec<usize>>
Iteratively calculates the index path to the element blueprint node with matching DOM node UID (O(1) call stack).
Sourcepub fn find_path_by_entity_id(&self, target_id: EntityId) -> Option<Vec<usize>>
pub fn find_path_by_entity_id(&self, target_id: EntityId) -> Option<Vec<usize>>
Iteratively calculates the index path to the element blueprint node with matching EntityId (O(1) call stack).
Sourcepub fn flatten_fragments(self) -> NodeBlueprint
pub fn flatten_fragments(self) -> NodeBlueprint
Iteratively flattens nested Fragment nodes within Element children, splicing fragment children directly into their parent elements without deep recursion.
Sourcepub fn compile_to_ir(&self, graph: &mut UiIrGraph) -> NodeId
pub fn compile_to_ir(&self, graph: &mut UiIrGraph) -> NodeId
Compiles this reactive blueprint tree into a contiguous 64-byte aligned UiIrGraph.
Trait Implementations§
Source§impl Clone for NodeBlueprint
impl Clone for NodeBlueprint
Source§fn clone(&self) -> NodeBlueprint
fn clone(&self) -> NodeBlueprint
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more