View Conversion API
This page documents the public APIs in flor::view related to view identity, generic view objects, and child-view sequences. For usage-oriented guidance, see Framework DSL.
Imports
ViewBox
ViewBox is the generic view object commonly used inside the framework and by container APIs:
The view!(...) macro converts a single view into ViewBox, and the views![...] macro generates Vec<ViewBox>.
ViewIdentity
ViewIdentity is the abstraction builders use to read view identity:
Currently both View and ViewBox implement ViewIdentity. Therefore builders based on ViewIdentity can be used not only with concrete views, but also with generic view objects and view wrappers whose return type is impl IntoView.
Common builders such as ClassBuilder, LayoutBuilder, EventBuilder, FocusIndexBuilder, DisableBuilder, TransformBuilder, and ZIndexBuilder all use ViewIdentity to locate the target view.
IntoView
IntoView converts a single view into ViewBox:
Implementations:
IntoView inherits ViewIdentity. If a function returns impl IntoView, the caller can still chain common builders:
IntoViewIter
IntoViewIter converts a value into an iterator of ViewBox. It is mainly used by container children, window root views, and ViewBuilder::views:
Implementations:
This means APIs accepting impl IntoViewIter can accept both a single view and the view list generated by views![...]:
ViewBuilder
ViewBuilder appends child views to an existing view:
views(...) accepts a child-view sequence. Because a single view also implements IntoViewIter, it can accept either one view or a views![...] list. push_view(...) appends one child view.
When passing initial children while creating a container, prefer the container constructor or views![...]. ViewBuilder is more suitable after you already have the parent view value.
Macros
The macros call IntoView::into_view(...) internally, so each element must implement IntoView.

