Struct rsiot_component_core::Component
source · pub struct Component<TMessage, TConfig> {
pub stream_input: StreamInput<TMessage>,
pub stream_output: StreamOutput<TMessage>,
pub config: TConfig,
pub function: Box<dyn IComponentFunction<TMessage, TConfig>>,
}
Expand description
Обобщенный компонент
Fields§
§stream_input: StreamInput<TMessage>
§stream_output: StreamOutput<TMessage>
§config: TConfig
§function: Box<dyn IComponentFunction<TMessage, TConfig>>
Implementations§
Trait Implementations§
source§impl<TMessage, TConfig> IComponent<TMessage> for Component<TMessage, TConfig>where
TConfig: Clone,
impl<TMessage, TConfig> IComponent<TMessage> for Component<TMessage, TConfig>where TConfig: Clone,
source§fn set_input(&mut self, stream_input: StreamInput<TMessage>)
fn set_input(&mut self, stream_input: StreamInput<TMessage>)
Задать входной поток
source§fn set_output(&mut self, stream_output: StreamOutput<TMessage>)
fn set_output(&mut self, stream_output: StreamOutput<TMessage>)
Задать выходной поток
source§fn spawn(&mut self) -> JoinHandle<()>
fn spawn(&mut self) -> JoinHandle<()>
Порождаем асинхронную задачу
source§fn set_and_spawn(
&mut self,
input: StreamInput<TMessage>,
output: StreamOutput<TMessage>
) -> JoinHandle<()>
fn set_and_spawn( &mut self, input: StreamInput<TMessage>, output: StreamOutput<TMessage> ) -> JoinHandle<()>
Задать входной и выходной потоки и запустить на выполнение
Auto Trait Implementations§
impl<TMessage, TConfig> !RefUnwindSafe for Component<TMessage, TConfig>
impl<TMessage, TConfig> Send for Component<TMessage, TConfig>where TConfig: Send, TMessage: Send,
impl<TMessage, TConfig> !Sync for Component<TMessage, TConfig>
impl<TMessage, TConfig> Unpin for Component<TMessage, TConfig>where TConfig: Unpin,
impl<TMessage, TConfig> !UnwindSafe for Component<TMessage, TConfig>
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