pub trait AsyncComponentController<C: AsyncComponent> {
    // Required methods
    fn sender(&self) -> &Sender<C::Input>;
    fn widget(&self) -> &C::Root;
    fn detach_runtime(&mut self);

    // Provided method
    fn emit(&self, event: C::Input) { ... }
}
Expand description

Shared behavior of component controller types.

Required Methods§

source

fn sender(&self) -> &Sender<C::Input>

Provides access to the component’s sender.

source

fn widget(&self) -> &C::Root

Returns the root widget of the component.

source

fn detach_runtime(&mut self)

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§

source

fn emit(&self, event: C::Input)

Emits an input to the component.

Implementors§