rsiot/components/cmp_leptos/component/
component.rs1use async_trait::async_trait;
2
3use crate::{
4 executor::{CmpInOut, Component, ComponentError, IComponentProcess},
5 message::{AuthPermissions, MsgDataBound},
6};
7
8use super::{fn_process::fn_process, Config, StoreBound};
9
10#[cfg(feature = "single-thread")]
11#[async_trait(?Send)]
12impl<TMsg, TInputStore, TOutputStore>
13 IComponentProcess<Config<TMsg, TInputStore, TOutputStore>, TMsg>
14 for Component<Config<TMsg, TInputStore, TOutputStore>, TMsg>
15where
16 TMsg: MsgDataBound + 'static,
17 TInputStore: StoreBound + 'static,
18 TOutputStore: StoreBound + 'static,
19{
20 async fn process(
21 &self,
22 config: Config<TMsg, TInputStore, TOutputStore>,
23 input: CmpInOut<TMsg>,
24 ) -> Result<(), ComponentError> {
25 fn_process(
26 config,
27 input.clone_with_new_id("cmp_leptos", AuthPermissions::FullAccess),
28 )
29 .await?;
30 Err(ComponentError::Execution("Stop execution".into()))
31 }
32}
33
34pub type Cmp<TMsg, TInputStore, TOutputStore> =
36 Component<Config<TMsg, TInputStore, TOutputStore>, TMsg>;