Skip to main content

DevelopmentNodeEnvironment_MicrosoftVSCodeDependency_22NodeVersion_Bundle_Clean_Debug_ElectronProfile_EsbuildCompiler_Mountain/IPC/WindServiceHandlers/Output/
OutputClear.rs

1//! Clear an output channel. Emits `sky://output/clear` with the
2//! channel name; Sky drops the channel's scroll buffer.
3
4use CommonLibrary::IPC::SkyEvent::SkyEvent;
5use serde_json::{Value, json};
6use tauri::{AppHandle, Emitter};
7
8use crate::IPC::WindServiceHandlers::Utilities::JsonValueHelpers::arg_string;
9
10pub async fn Fn(ApplicationHandle:AppHandle, Arguments:Vec<Value>) -> Result<Value, String> {
11	let ChannelName = arg_string(&Arguments, 0);
12
13	let _ = ApplicationHandle.emit(SkyEvent::OutputClear.AsStr(), json!({ "channel": ChannelName }));
14
15	Ok(Value::Null)
16}