rsiot/components/cmp_filesystem/
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, BufferBound};
9
10#[cfg_attr(not(feature = "single-thread"), async_trait)]
11#[cfg_attr(feature = "single-thread", async_trait(?Send))]
12impl<TMsg, TBuffer> IComponentProcess<Config<TMsg, TBuffer>, TMsg>
13    for Component<Config<TMsg, TBuffer>, TMsg>
14where
15    TMsg: MsgDataBound + 'static,
16    TBuffer: BufferBound,
17{
18    async fn process(&self, config: Config<TMsg, TBuffer>, in_out: CmpInOut<TMsg>) -> CmpResult {
19        let in_out = in_out.clone_with_new_id("cmp_filesystem", AuthPermissions::FullAccess);
20        fn_process(config, in_out).await?;
21        Ok(())
22    }
23}
24
25/// Компонент cmp_filesystem
26pub type Cmp<TMsg, TBuffer> = Component<Config<TMsg, TBuffer>, TMsg>;