pub struct Component<WIDGET: Widget> { /* private fields */ }
Expand description
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 Component
s 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).
Implementations§
source§impl<WIDGET: Widget> Component<WIDGET>
impl<WIDGET: Widget> Component<WIDGET>
sourcepub fn stream(&self) -> StreamHandle<WIDGET::Msg>
pub fn stream(&self) -> StreamHandle<WIDGET::Msg>
Get the event stream of the component. This is used internally by the library.
sourcepub fn owned_stream(&self) -> &EventStream<WIDGET::Msg>
pub fn owned_stream(&self) -> &EventStream<WIDGET::Msg>
Get the event stream of the component. This is used internally by the library.
Auto Trait Implementations§
impl<WIDGET> RefUnwindSafe for Component<WIDGET>where <WIDGET as Update>::Msg: RefUnwindSafe, <WIDGET as Widget>::Root: RefUnwindSafe,
impl<WIDGET> !Send for Component<WIDGET>
impl<WIDGET> !Sync for Component<WIDGET>
impl<WIDGET> Unpin for Component<WIDGET>where <WIDGET as Widget>::Root: Unpin,
impl<WIDGET> UnwindSafe for Component<WIDGET>where <WIDGET as Update>::Msg: RefUnwindSafe, <WIDGET as Widget>::Root: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more