pub struct ContainerComponent<WIDGET: Container + Widget> {
    pub container: WIDGET::Container,
    pub containers: WIDGET::Containers,
    /* private fields */
}
Expand description

Struct for relm containers to add GTK+ and relm Widgets.

Fields§

§container: WIDGET::Container

The default container of this component.

§containers: WIDGET::Containers

Additional containers used for multi-containers. This can be () if not needed.

Implementations§

source§

impl<WIDGET: Container + Widget> ContainerComponent<WIDGET>

source

pub fn add<CHILDWIDGET: IsA<Widget>>(&self, widget: &CHILDWIDGET)

Add a GTK+ widget to a relm container.

source

pub fn add_widget<CHILDWIDGET>( &self, model_param: CHILDWIDGET::ModelParam ) -> Component<CHILDWIDGET>where CHILDWIDGET: Widget + 'static, WIDGET::Container: ContainerExt + IsA<Widget> + IsA<Object>,

Add a relm widget to a relm container.

source

pub fn emit(&self, msg: WIDGET::Msg)

Emit a message of the widget stream.

source

pub fn owned_stream(&self) -> &EventStream<WIDGET::Msg>

Get the event stream of the component. This is used internally by the library.

source

pub fn stream(&self) -> StreamHandle<WIDGET::Msg>

Get the event stream of the component. This is used internally by the library.

source

pub fn widget(&self) -> &WIDGET::Root

Get the widget of the component.

Auto Trait Implementations§

§

impl<WIDGET> RefUnwindSafe for ContainerComponent<WIDGET>where <WIDGET as Container>::Container: RefUnwindSafe, <WIDGET as Container>::Containers: RefUnwindSafe, <WIDGET as Update>::Msg: RefUnwindSafe, <WIDGET as Widget>::Root: RefUnwindSafe,

§

impl<WIDGET> !Send for ContainerComponent<WIDGET>

§

impl<WIDGET> !Sync for ContainerComponent<WIDGET>

§

impl<WIDGET> Unpin for ContainerComponent<WIDGET>where <WIDGET as Container>::Container: Unpin, <WIDGET as Container>::Containers: Unpin, <WIDGET as Widget>::Root: Unpin,

§

impl<WIDGET> UnwindSafe for ContainerComponent<WIDGET>where <WIDGET as Container>::Container: UnwindSafe, <WIDGET as Container>::Containers: UnwindSafe, <WIDGET as Update>::Msg: RefUnwindSafe, <WIDGET as Widget>::Root: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.