Trait Container

Source
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§

Source

type Container: Clone + IsA<Container> + IsA<Object> + IsA<Widget>

The type of the containing widget, i.e. where the child widgets will be added.

Source

type Containers: Clone

Type to contain the additional container widgets.

Required Methods§

Source

fn container(&self) -> &Self::Container

Get the containing widget, i.e. the widget where the children will be added.

Source

fn other_containers(&self) -> Self::Containers

Get additional container widgets. This is useful to create a multi-container.

Provided Methods§

Source

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.

Implementors§