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 Request:CreateOutputChannelRequest,
18) -> Result<Response<CreateOutputChannelResponse>, Status> {
19 dev_log!("cocoon", "[CocoonService] create_output_channel: '{}'", Request.name);
20
21 let _ = Service
22 .environment
23 .ApplicationHandle
24 .emit("sky://output/create", json!({ "channel": Request.name }));
25
26 Ok(Response::new(CreateOutputChannelResponse { channel_id:Request.name.clone() }))
27}