Trait relm::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().

Implementors§