pub struct TextNode { /* private fields */ }Expand description
Represents a text node in the virtual DOM.
Text nodes may optionally be bound to a reactive signal for automatic updates.
OPT 29: content is Cow<'static, str> instead of String so the
html! macro can emit Cow::Borrowed("...") for literal text
without allocating a String per text node per render. Runtime
text (signals, format!, to_string()) still falls through to
Cow::Owned. The renderer’s set_text_content and
create_text_node calls take &str, which is what Cow<'static, str>
derefs to, so call sites use .as_ref() (yields &str).
Implementations§
Trait Implementations§
Source§impl PartialEq for TextNode
Visual equality comparison for text nodes.
impl PartialEq for TextNode
Visual equality comparison for text nodes.
Only compares the text content; the backing signal is not considered because it does not affect visual output.
OPT 29: content is Cow<'static, str>; compare the dereffed
string views (cheap for both Borrowed and Owned).