pub enum View {
Element(Element),
Text(String),
Fragment(Vec<View>),
Empty,
}Expand description
A rendered (or about-to-be-rendered) tree fragment.
Variants§
Element(Element)
A single element handle the caller has already created.
Text(String)
A text snippet — materialize creates a raw_text element
with text=<value>. The IntoView impls for &str /
String / primitive numeric types route through here so
{count.get()} inside render! can interpolate scalar
values without the caller having to manually wrap them in a
raw_text { … } element.
Fragment(Vec<View>)
Zero-or-more child views in order. Tuples, option-some /
option-none → empty, iterator flattening, and the macro’s
multi-child Show children all use this.
Empty
A view with no on-screen footprint — Show { when: false }
and Option::None.
Implementations§
Source§impl View
impl View
Sourcepub fn attach_to(self, parent: Element) -> Vec<Element>
pub fn attach_to(self, parent: Element) -> Vec<Element>
Realise the view: create whatever element handles the text /
fragment variants require, append them to parent, and return
the resulting flat list of leaf handles in attach order. The
returned list is what the {expr} macro path stashes so the
next effect re-run can detach the previous children before
attaching the new ones.