Trait WidgetChildrenExt

Source
pub trait WidgetChildrenExt<S: State> {
    // Required methods
    fn set_children(&mut self, children: Vec<Val<S, impl Widget<S> + 'static>>);
    fn add_child<W: Widget<S> + 'static>(&mut self, child: impl Into<Val<S, W>>);

    // Provided methods
    fn with_children(
        self,
        children: Vec<Val<S, impl Widget<S> + 'static>>,
    ) -> Self
       where Self: Sized { ... }
    fn with_child<W: Widget<S> + 'static>(
        self,
        child: impl Into<Val<S, W>>,
    ) -> Self
       where Self: Sized { ... }
}
Expand description

An extension trait for widgets with multiple child widgets.

Required Methods§

Source

fn set_children(&mut self, children: Vec<Val<S, impl Widget<S> + 'static>>)

Sets the child widgets of the widget.

Source

fn add_child<W: Widget<S> + 'static>(&mut self, child: impl Into<Val<S, W>>)

Adds a child widget to the widget.

Provided Methods§

Source

fn with_children(self, children: Vec<Val<S, impl Widget<S> + 'static>>) -> Self
where Self: Sized,

Sets the child widgets of the widget and returns self.

Source

fn with_child<W: Widget<S> + 'static>(self, child: impl Into<Val<S, W>>) -> Self
where Self: Sized,

Adds a child widget to the widget and returns self.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§