Expand description
Layer 1: the declarative View trait.
Views are cheap, short-lived descriptors produced by a root component’s Component::build
closure, a pure function of application state (fn build(&mut State) -> impl View<State>).
They are not the retained tree — re-running the build closure on every state
mutation must stay cheap by construction.
The lifecycle mirrors xilem_core’s proven View design
(build/rebuild/teardown/message) but owns its implementation: no
xilem/masonry dependency. The Action generic is intentionally omitted for
v0 — messages route directly against State.
Structs§
- AnyView
- A type-erased
View: lets a piece of UI change its concrete view type between frames (e.g. a conditionalif cond { text(..) } else { button(..) }) while still fitting the statically-typed rebuild machinery. - Build
Ctx - Context threaded through
View::build/View::rebuild. - Change
Flags - Bitflags describing what work a
View::rebuildpass invalidated. - Widget
Id - A stable identity for a node in the widget tree.
Traits§
- View
- A declarative description of a piece of UI.
Functions§
- any
- Erase
viewinto anAnyView— the free-function spelling ofAnyView::new, mirroring thetext(..)/button(..)view-fn vocabulary.