Struct iced_web::Element[][src]

pub struct Element<'a, Message> { /* fields omitted */ }

A generic Widget.

It is useful to build composable user interfaces that do not leak implementation details in their view logic.

If you have a built-in widget, you should be able to use Into<Element> to turn it into an Element.

Implementations

impl<'a, Message> Element<'a, Message>[src]

pub fn new(widget: impl Widget<Message> + 'a) -> Self[src]

Create a new Element containing the given Widget.

pub fn map<F, B>(self, f: F) -> Element<'a, B> where
    Message: 'static,
    B: 'static,
    F: 'static + Fn(Message) -> B, 
[src]

Applies a transformation to the produced message of the Element.

This method is useful when you want to decouple different parts of your UI and make them composable.

pub fn explain(self, _color: Color) -> Element<'a, Message>[src]

Marks the Element as to-be-explained.

pub fn node<'b>(
    &self,
    bump: &'b Bump,
    bus: &Bus<Message>,
    style_sheet: &mut Css<'b>
) -> Node<'b>
[src]

Produces a VDOM node for the Element.

Trait Implementations

impl<'a, Message> From<Button<'a, Message>> for Element<'a, Message> where
    Message: 'static + Clone
[src]

impl<'a, Message> From<Checkbox<Message>> for Element<'a, Message> where
    Message: 'static, 
[src]

impl<'a, Message> From<Column<'a, Message>> for Element<'a, Message> where
    Message: 'static, 
[src]

impl<'a, Message> From<Container<'a, Message>> for Element<'a, Message> where
    Message: 'static, 
[src]

impl<'a, Message> From<Image> for Element<'a, Message>[src]

impl<'a, Message> From<ProgressBar> for Element<'a, Message> where
    Message: 'static, 
[src]

impl<'a, Message> From<Radio<Message>> for Element<'a, Message> where
    Message: 'static + Clone
[src]

impl<'a, Message> From<Row<'a, Message>> for Element<'a, Message> where
    Message: 'static, 
[src]

impl<'a, Message> From<Scrollable<'a, Message>> for Element<'a, Message> where
    Message: 'static, 
[src]

impl<'a, T, Message> From<Slider<'a, T, Message>> for Element<'a, Message> where
    T: 'static + Copy + Into<f64> + FromPrimitive,
    Message: 'static, 
[src]

impl<'a, Message> From<Space> for Element<'a, Message>[src]

impl<'a, Message> From<TextInput<'a, Message>> for Element<'a, Message> where
    Message: 'static + Clone
[src]

Auto Trait Implementations

impl<'a, Message> !RefUnwindSafe for Element<'a, Message>

impl<'a, Message> !Send for Element<'a, Message>

impl<'a, Message> !Sync for Element<'a, Message>

impl<'a, Message> Unpin for Element<'a, Message>

impl<'a, Message> !UnwindSafe for Element<'a, Message>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.