pub trait ComponentController<C: Component> {
    fn sender(&self) -> &Sender<C::Input>;
    fn state(&self) -> &StateWatcher<C>;
    fn widget(&self) -> &C::Root;
    fn detach_runtime(&mut self);

    fn emit(&self, event: C::Input) { ... }
    fn model(&self) -> Ref<'_, C> { ... }
    fn widgets(&self) -> Ref<'_, C::Widgets> { ... }
}
Expand description

Shared behavior of component controller types.

Required Methods§

Provides access to the component’s sender.

Provides access to the state of a component.

Returns the root widget of the component.

Dropping this type will usually stop the runtime of the component. With this method you can give the runtime a static lifetime. In other words, dropping the controller or connector will not stop the runtime anymore, instead it will run until the app is closed.

Provided Methods§

Emits an input to the component.

Returns a reference to the Component.

Returns a reference to the Component::Widgets.

Implementors§