Mountain/IPC/WindServiceHandlers/Output/
OutputAppendLine.rs1#![allow(non_snake_case)]
2
3use CommonLibrary::IPC::SkyEvent::SkyEvent;
8use serde_json::{Value, json};
9use tauri::{AppHandle, Emitter};
10
11pub async fn OutputAppendLine(ApplicationHandle:AppHandle, Arguments:Vec<Value>) -> Result<Value, String> {
12 let ChannelName = Arguments.first().and_then(|V| V.as_str()).unwrap_or("").to_string();
13 let Text = Arguments.get(1).and_then(|V| V.as_str()).unwrap_or("").to_string();
14 let Line = format!("{}\n", Text);
15
16 let _ = ApplicationHandle.emit(SkyEvent::OutputAppend.AsStr(), json!({ "channel": ChannelName, "text": Line }));
17 Ok(Value::Null)
18}