rsiot/components/cmp_influxdb3/
component.rs

1use async_trait::async_trait;
2
3use tracing::error;
4
5use crate::{
6    executor::{CmpInOut, Component, ComponentError, IComponentProcess},
7    message::{AuthPermissions, MsgDataBound},
8};
9
10use super::{fn_process::fn_process, Config};
11
12#[cfg_attr(not(feature = "single-thread"), async_trait)]
13#[cfg_attr(feature = "single-thread", async_trait(?Send))]
14impl<TMsg> IComponentProcess<Config<TMsg>, TMsg> for Component<Config<TMsg>, TMsg>
15where
16    TMsg: MsgDataBound + 'static,
17{
18    async fn process(
19        &self,
20        config: Config<TMsg>,
21        in_out: CmpInOut<TMsg>,
22    ) -> Result<(), ComponentError> {
23        fn_process(
24            in_out.clone_with_new_id("cmp_influxdb", AuthPermissions::FullAccess),
25            config,
26        )
27        .await?;
28        error!("Influxdb client component end execution");
29        Ok(())
30    }
31}
32
33/// Компонент cmp_influxdb
34pub type Cmp<TMsg> = Component<Config<TMsg>, TMsg>;