pub enum Element<Msg> {
Box(BoxElement<Msg>),
Text(TextElement),
Spacer,
_Phantom(PhantomData<Msg>),
}Expand description
A node in the UI element tree.
Elements are the building blocks of the declarative UI. Use col![] and row![]
macros for concise construction.
Variants§
Box(BoxElement<Msg>)
A container with Flexbox layout.
Text(TextElement)
Styled text content.
Spacer
Flexible space that expands to fill available room.
_Phantom(PhantomData<Msg>)
Implementations§
Source§impl<Msg> Element<Msg>
impl<Msg> Element<Msg>
Sourcepub fn text_content(&self) -> Option<&str>
pub fn text_content(&self) -> Option<&str>
Get the text content if this is a Text element.
Sourcepub fn child_count(&self) -> usize
pub fn child_count(&self) -> usize
Count total children (0 for non-Box elements).
Auto Trait Implementations§
impl<Msg> Freeze for Element<Msg>
impl<Msg> RefUnwindSafe for Element<Msg>where
Msg: RefUnwindSafe,
impl<Msg> Send for Element<Msg>where
Msg: Send,
impl<Msg> Sync for Element<Msg>where
Msg: Sync,
impl<Msg> Unpin for Element<Msg>where
Msg: Unpin,
impl<Msg> UnsafeUnpin for Element<Msg>
impl<Msg> UnwindSafe for Element<Msg>where
Msg: UnwindSafe,
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
Mutably borrows from an owned value. Read more