pub enum Element {
Empty,
Control(Box<ControlElement>),
Text(Rc<str>),
Fragment(Vec<Element>),
Dynamic(DynamicChildren),
Existing(Ref<Control>),
}Expand description
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.
Variants§
Empty
Nothing.
Control(Box<ControlElement>)
A control.
Text(Rc<str>)
Text: the text of the content of its parent, or a TextBlock where a
control is needed.
Fragment(Vec<Element>)
Several elements in place of one.
Dynamic(DynamicChildren)
Children that follow reactive state.
Existing(Ref<Control>)
A control made elsewhere (a XAML user control, a control kept by the application).
Implementations§
Source§impl Element
impl Element
Sourcepub fn mount(self) -> Ref<Control>
pub fn mount(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. 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.
Sourcepub fn mount_root(self) -> (Ref<Control>, Owner)
pub fn mount_root(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.
Trait Implementations§
Source§impl IntoElement for Element
impl IntoElement for Element
Source§fn into_element(self) -> Element
fn into_element(self) -> Element
Auto Trait Implementations§
impl !RefUnwindSafe for Element
impl !Send for Element
impl !Sync for Element
impl !UnwindSafe for Element
impl Freeze for Element
impl Unpin for Element
impl UnsafeUnpin for Element
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
affects_render, metadata
overrides). Read moreSource§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FromValue<Option<T>> for Twhere
T: Clone,
impl<T> FromValue<Option<T>> for Twhere
T: Clone,
Source§fn from_value(value: &Option<T>) -> Option<T>
fn from_value(value: &Option<T>) -> Option<T>
None when the value of the property has
none (the signal keeps its value).Source§impl<T> FromValue<T> for Twhere
T: Clone,
impl<T> FromValue<T> for Twhere
T: Clone,
Source§fn from_value(value: &T) -> Option<T>
fn from_value(value: &T) -> Option<T>
None when the value of the property has
none (the signal keeps its value).