pub trait IComponent<TMessage> {
    // Required methods
    fn set_input(&mut self, input: Input<TMessage>);
    fn set_output(&mut self, output: Output<TMessage>);
    fn spawn(&mut self) -> JoinHandle<()>;

    // Provided method
    fn set_and_spawn(
        &mut self,
        input: Input<TMessage>,
        output: Output<TMessage>
    ) -> JoinHandle<()> { ... }
}
Expand description

Трейт для работы с компонентом из построителя цепочки компонентов ComponentChainBuilder

Required Methods§

source

fn set_input(&mut self, input: Input<TMessage>)

Задать входной поток

source

fn set_output(&mut self, output: Output<TMessage>)

Задать выходной поток

source

fn spawn(&mut self) -> JoinHandle<()>

Порождаем асинхронную задачу

Provided Methods§

source

fn set_and_spawn( &mut self, input: Input<TMessage>, output: Output<TMessage> ) -> JoinHandle<()>

Задать входной и выходной потоки и запустить на выполнение

Implementors§

source§

impl<TMessage, TConfig> IComponent<TMessage> for Component<TMessage, TConfig>