rsiot/components/cmp_timescaledb/
component.rs1use async_trait::async_trait;
2
3use crate::message::{AuthPermissions, MsgDataBound};
4
5use crate::executor::{CmpInOut, Component, ComponentError, IComponentProcess};
6
7use super::{config::Config, fn_process::fn_process};
8
9#[cfg_attr(not(feature = "single-thread"), async_trait)]
10#[cfg_attr(feature = "single-thread", async_trait(?Send))]
11impl<TMsg> IComponentProcess<Config<TMsg>, TMsg> for Component<Config<TMsg>, TMsg>
12where
13 TMsg: MsgDataBound,
14{
15 async fn process(
16 &self,
17 config: Config<TMsg>,
18 input: CmpInOut<TMsg>,
19 ) -> Result<(), ComponentError> {
20 fn_process(
21 input.clone_with_new_id("cmp_timescaledb_storing", AuthPermissions::FullAccess),
22 config,
23 )
24 .await
25 }
26}
27
28pub type Cmp<TMsg> = Component<Config<TMsg>, TMsg>;