pub trait Worker: Sized + Send + 'static {
    type Init: 'static + Send;
    type Input: 'static + Send + Debug;
    type Output: 'static + Send + Debug;

    fn init(init: Self::Init, sender: ComponentSender<Self>) -> Self;
    fn update(&mut self, message: Self::Input, sender: ComponentSender<Self>);
Expand description

Receives inputs and outputs in the background.

Required Associated Types§

The initial parameters that will be used to build the worker state.

The type of inputs that this worker shall receive.

The type of outputs that this worker shall send.

Required Methods§

Defines the initial state of the worker.

Defines how inputs will bep processed