pub trait Container: Widget {
type Container: Clone + IsA<Container> + IsA<Object> + IsA<Widget>;
type Containers: Clone;
// Required methods
fn container(&self) -> &Self::Container;
fn other_containers(&self) -> Self::Containers;
// Provided method
fn add_widget<WIDGET: Widget>(
container: &ContainerComponent<Self>,
component: &Component<WIDGET>,
) -> Container { ... }
}
Expand description
Trait to implement relm container widget.
Required Associated Types§
Sourcetype Container: Clone + IsA<Container> + IsA<Object> + IsA<Widget>
type Container: Clone + IsA<Container> + IsA<Object> + IsA<Widget>
The type of the containing widget, i.e. where the child widgets will be added.
Sourcetype Containers: Clone
type Containers: Clone
Type to contain the additional container widgets.
Required Methods§
Sourcefn container(&self) -> &Self::Container
fn container(&self) -> &Self::Container
Get the containing widget, i.e. the widget where the children will be added.
Sourcefn other_containers(&self) -> Self::Containers
fn other_containers(&self) -> Self::Containers
Get additional container widgets. This is useful to create a multi-container.
Provided Methods§
Sourcefn add_widget<WIDGET: Widget>(
container: &ContainerComponent<Self>,
component: &Component<WIDGET>,
) -> Container
fn add_widget<WIDGET: Widget>( container: &ContainerComponent<Self>, component: &Component<WIDGET>, ) -> Container
Add a relm widget to this container. Return the widget that will be send to Widget::on_add().
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.