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