Skip to main content

DevelopmentNodeEnvironment_MicrosoftVSCodeDependency_22NodeVersion_Bundle_Clean_Debug_ElectronProfile_EsbuildCompiler_Mountain/IPC/WindServiceHandlers/NativeHost/
Exit.rs

1//! `nativeHost:exit` - exit with an explicit code.
2//! VS Code calls this from `NativeHostMainService.exit(code)` when an
3//! extension or the workbench requests a non-zero exit (crash reporter,
4//! restart-on-crash sentinel, etc.).
5
6use serde_json::Value;
7use tauri::AppHandle;
8
9use crate::{IPC::WindServiceHandlers::Utilities::JsonValueHelpers::arg_i64, dev_log};
10
11pub async fn Fn(ApplicationHandle:AppHandle, Arguments:Vec<Value>) -> Result<Value, String> {
12	let Code = arg_i64(&Arguments, 0) as i32;
13
14	dev_log!("lifecycle", "nativeHost:exit code={}", Code);
15
16	ApplicationHandle.exit(Code);
17
18	Ok(Value::Null)
19}