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§
Sourcefn set_children(&mut self, children: Vec<BoxedWidget>)
fn set_children(&mut self, children: Vec<BoxedWidget>)
Sets the child widgets of the widget.
Provided Methods§
Sourcefn with_children(self, children: Vec<BoxedWidget>) -> Selfwhere
Self: Sized,
fn with_children(self, children: Vec<BoxedWidget>) -> Selfwhere
Self: Sized,
Sets the child widgets of the widget and returns self.
Sourcefn with_child(self, child: impl Widget + 'static) -> Selfwhere
Self: Sized,
fn with_child(self, child: impl Widget + 'static) -> Selfwhere
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.