Element
enum · ferroui-view · v0.5.0
enum Element
A description of user interface: a control with its properties and children, text, several elements, a list that follows state, or a control that exists already.
Members
Empty
Empty
Nothing.
Control
Control(Box<ControlElement>)
A control.
Text
Text(std::rc::Rc<str>)
Text: the text of the content of its parent, or a TextBlock where a
control is needed.
Fragment
Fragment(Vec<Element>)
Several elements in place of one.
List
List(Vec<Element>)
The elements of an iteration (for in rsx!, a Vec): a fragment
whose items are checked for keys in debug builds.
Dynamic
Dynamic(DynamicChildren)
Children that follow reactive state.
Existing
Existing(ferroui_base::Ref<ferroui_controls::Control>)
A control made elsewhere (a XAML user control, a control kept by the application).
Component
Component(ComponentElement)
A component that runs again (see rerender).
mount
fn mount(self: Self) -> Ref<Control>
Mounts the element as a control: creates the controls of the tree,
gives them their values and children, attaches their handlers and
starts the effects of their reactive values and the components that
run again. The effects belong to the current owner (see Owner):
disposing it stops them.
Text becomes a TextBlock, and several elements a StackPanel.
Panics
Panics for an empty element or a dynamic list, which have no control of their own.
mount_root
fn mount_root(self: Self) -> (Ref<Control>, Owner)
Mounts the element under a new owner of its own, which is disposed when the returned owner is: the root of a window or of a piece of user interface that ends on its own.
key
fn key(self: &Self) -> Option<&Key>
The key of the element, if it has one.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeIntoValue<T>FromValue<T>FromValue<Option<T>>IntoProp<T, Value>IntoProp<Option<Rc<dyn AnyValue>>, FromElement>IntoProp<Option<Ref<T>>, FromControlElement>IntoChildBorrow<T>BorrowMut<T>CloneToUninitInto<U>From<T>TryInto<U>TryFrom<U>AnyToOwnedClassDefaultsErasedDestructorIntoEitherFrom<El<T>>CloneDefaultDebugIntoElement
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.