Mountain/RPC/CocoonService/Output/AppendOutput.rs
1#![allow(non_snake_case)]
2
3//! Append text to an output channel via `sky://output/append`.
4
5use serde_json::json;
6use tauri::Emitter;
7use tonic::{Response, Status};
8
9use crate::{
10 RPC::CocoonService::CocoonServiceImpl,
11 Vine::Generated::{AppendOutputRequest, Empty},
12};
13
14pub async fn Fn(Service:&CocoonServiceImpl, Request:AppendOutputRequest) -> Result<Response<Empty>, Status> {
15 let _ = Service.environment.ApplicationHandle.emit(
16 "sky://output/append",
17 json!({ "channel": Request.channel_id, "text": Request.value }),
18 );
19 Ok(Response::new(Empty {}))
20}