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