Skip to main content

Element

Struct Element 

Source
pub struct Element<Message> {
    pub kind: ElementKind<Message>,
    pub layout: Layout,
    pub style: Style,
    pub focusable: bool,
    pub continuity_key: Option<String>,
    pub children: Vec<Element<Message>>,
}

Fields§

§kind: ElementKind<Message>§layout: Layout§style: Style§focusable: bool§continuity_key: Option<String>§children: Vec<Element<Message>>

Implementations§

Source§

impl<Message> Element<Message>

Source

pub fn new(kind: ElementKind<Message>) -> Self

Source

pub fn new_text(content: impl Into<String>) -> Self

Source

pub fn with_layout(self, layout: Layout) -> Self

Source

pub fn with_style(self, style: Style) -> Self

Source

pub fn with_focusable(self, focusable: bool) -> Self

Source

pub fn with_continuity_key(self, key: impl Into<String>) -> Self

Source

pub fn with_children(self, children: Vec<Element<Message>>) -> Self

Source

pub fn continuity_key(&self) -> Option<&str>

Source

pub fn child_layout_spec(&self, bounds: Rect) -> ChildLayoutSpec

Source

pub fn intrinsic_height(&self, width: u16, child_heights: &[u16]) -> u16

Source

pub fn intrinsic_width(&self, child_widths: &[u16]) -> u16

Source

pub fn invalidates_self_on_layout_change(&self) -> bool

Source

pub fn kind_name(&self) -> &'static str

Trait Implementations§

Source§

impl<Message> Debug for Element<Message>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<Message> IntoElement<Message> for Element<Message>

Source§

fn into_element(self) -> Element<Message>

Auto Trait Implementations§

§

impl<Message> Freeze for Element<Message>

§

impl<Message> !RefUnwindSafe for Element<Message>

§

impl<Message> !Send for Element<Message>

§

impl<Message> !Sync for Element<Message>

§

impl<Message> Unpin for Element<Message>

§

impl<Message> UnsafeUnpin for Element<Message>

§

impl<Message> !UnwindSafe for Element<Message>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.