FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    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.

    View source

    Members

    Empty

    Empty
    

    Nothing.

    Source

    Control

    Control(Box<ControlElement>)
    

    A control.

    Source

    Text

    Text(std::rc::Rc<str>)
    

    Text: the text of the content of its parent, or a TextBlock where a control is needed.

    Source

    Fragment

    Fragment(Vec<Element>)
    

    Several elements in place of one.

    Source

    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.

    Source

    Dynamic

    Dynamic(DynamicChildren)
    

    Children that follow reactive state.

    Source

    Existing

    Existing(ferroui_base::Ref<ferroui_controls::Control>)
    

    A control made elsewhere (a XAML user control, a control kept by the application).

    Source

    Component

    Component(ComponentElement)
    

    A component that runs again (see rerender).

    Source

    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.

    Source

    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.

    Source

    key

    fn key(self: &Self) -> Option<&Key>
    

    The key of the element, if it has one.

    Source

    Trait implementations

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.