DevelopmentNodeEnvironment_MicrosoftVSCodeDependency_22NodeVersion_Bundle_Clean_Debug_ElectronProfile_EsbuildCompiler_Mountain/RPC/CocoonService/Output/
CreateOutputChannel.rs1use serde_json::json;
4use tauri::Emitter;
5use tonic::{Response, Status};
6
7use crate::{
8 RPC::CocoonService::CocoonServiceImpl,
9 Vine::Generated::{CreateOutputChannelRequest, CreateOutputChannelResponse},
10 dev_log,
11};
12
13pub async fn Fn(
14 Service:&CocoonServiceImpl,
15
16 Request:CreateOutputChannelRequest,
17) -> Result<Response<CreateOutputChannelResponse>, Status> {
18 dev_log!("cocoon", "[CocoonService] create_output_channel: '{}'", Request.name);
19
20 let _ = Service
24 .environment
25 .ApplicationHandle
26 .emit("sky://output/create", json!({ "id": Request.name, "name": Request.name }));
27
28 Ok(Response::new(CreateOutputChannelResponse { channel_id:Request.name.clone() }))
29}