Skip to main content

Mountain/RPC/CocoonService/Output/
AppendOutput.rs

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