Skip to main content

DevelopmentNodeEnvironment_MicrosoftVSCodeDependency_22NodeVersion_Bundle_Clean_Debug_ElectronProfile_EsbuildCompiler_Mountain/IPC/WindServiceHandlers/NativeHost/
Exit.rs

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