Common/Output/
RegisterOutputChannel.rs1use std::sync::Arc;
6
7use super::OutputChannelManager::OutputChannelManager;
8use crate::{Effect::ActionEffect::ActionEffect, Error::CommonError::CommonError};
9
10pub fn RegisterOutputChannel(
23 Name:String,
24
25 LanguageIdentifier:Option<String>,
26) -> ActionEffect<Arc<dyn OutputChannelManager>, CommonError, String> {
27 ActionEffect::New(Arc::new(move |Manager:Arc<dyn OutputChannelManager>| {
28 let NameClone = Name.clone();
29
30 let LanguageIdentifierClone = LanguageIdentifier.clone();
31
32 Box::pin(async move { Manager.RegisterChannel(NameClone, LanguageIdentifierClone).await })
33 }))
34}