[][src]Struct relm::Component

#[must_use]
pub struct Component<WIDGET: Widget> { /* fields omitted */ }

Widget that was added by the ContainerWidget::add_widget() method.

Warning

You must keep your components as long as you want them to send/receive events. Common practice is to store Components in the Widget struct (see the communication example). The #[widget] attribute takes care of storing them in the struct automatically (see the communication-attribute example).

Methods

impl<WIDGET: Widget> Component<WIDGET>[src]

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

Emit a message of the widget stream.

pub fn stream(&self) -> &EventStream<WIDGET::Msg>[src]

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

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

Get the widget of the component.

Trait Implementations

impl<WIDGET: Widget> Drop for Component<WIDGET>[src]

impl<WIDGET: Widget> Clone for Component<WIDGET>[src]

default fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl<WIDGET> !Send for Component<WIDGET>

impl<WIDGET> !Sync for Component<WIDGET>

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.