WidgetChildrenExt

Trait WidgetChildrenExt 

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

    // Provided methods
    fn with_children(self, children: Vec<BoxedWidget>) -> Self
       where Self: Sized { ... }
    fn with_child(self, child: impl Widget + 'static) -> 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<BoxedWidget>)

Sets the child widgets of the widget.

Source

fn add_child(&mut self, child: impl Widget + 'static)

Adds a child widget to the widget.

Provided Methods§

Source

fn with_children(self, children: Vec<BoxedWidget>) -> Self
where Self: Sized,

Sets the child widgets of the widget and returns self.

Source

fn with_child(self, child: impl Widget + 'static) -> 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§