rsiot/components/cmp_linux_uart_master/
component.rs

1use async_trait::async_trait;
2
3use crate::{
4    executor::{CmpInOut, CmpResult, Component, IComponentProcess},
5    message::{AuthPermissions, MsgDataBound},
6};
7
8use super::{config::Config, fn_process::fn_process};
9
10#[cfg_attr(not(feature = "single-thread"), async_trait)]
11#[cfg_attr(feature = "single-thread", async_trait(?Send))]
12impl<TMsg> IComponentProcess<Config<TMsg>, TMsg> for Component<Config<TMsg>, TMsg>
13where
14    TMsg: MsgDataBound + 'static,
15{
16    async fn process(&self, config: Config<TMsg>, msg_bus: CmpInOut<TMsg>) -> CmpResult {
17        let in_out =
18            msg_bus.clone_with_new_id("cmp_linux_uart_master", AuthPermissions::FullAccess);
19        fn_process(config, in_out).await?;
20        Ok(())
21    }
22}
23
24/// Компонент cmp_linux_uart_master
25pub type Cmp<TMsg> = Component<Config<TMsg>, TMsg>;