Skip to main content

Widget

Trait Widget 

Source
pub trait Widget: 'static {
    // Provided methods
    fn build(&mut self, scope: &Scope) -> Result { ... }
    fn mount(self, parent: &Scope) -> Result<Mounted>
       where Self: Sized { ... }
    fn show_in(self, parent: &Scope) -> Result
       where Self: Sized { ... }
}
Expand description

A widget is built once; dynamic props/control flow install owned bindings.

Provided Methods§

Source

fn build(&mut self, scope: &Scope) -> Result

Source

fn mount(self, parent: &Scope) -> Result<Mounted>
where Self: Sized,

Source

fn show_in(self, parent: &Scope) -> Result
where Self: Sized,

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<W: Widget + ?Sized> Widget for Box<W>

Source§

fn build(&mut self, scope: &Scope) -> Result

Source§

impl<W: Widget> Widget for Option<W>

Implementors§

Source§

impl Widget for Button

Source§

impl Widget for Check

Source§

impl Widget for File

Source§

impl Widget for Fragment

Source§

impl Widget for Graphic

Source§

impl Widget for Group

Source§

impl Widget for Image

Source§

impl Widget for Input

Source§

impl Widget for RichEditor

Source§

impl Widget for Select

Source§

impl Widget for Text

Source§

impl Widget for View

Source§

impl Widget for When

Source§

impl<F, W> Widget for Deferred<F>
where F: FnOnce() -> W + 'static, W: Widget,

Source§

impl<F: FnMut(&Scope) -> Result + 'static> Widget for WidgetFn<F>

Source§

impl<K: Clone + Eq + Hash + 'static> Widget for List<K>

Source§

impl<S, F, W> Widget for Each<S, F>
where S: Source, F: FnMut(S::Row) -> W + 'static, W: Widget,