tauri-sys/src/process.rs
Jonas Kruckenberg e638b5c289 wip
2022-11-17 19:03:46 +01:00

24 lines
528 B
Rust

//! Perform operations on the current process.
/// Exits immediately with the given `exit_code`.
#[inline(always)]
pub async fn exit(exit_code: i32) -> ! {
inner::exit(exit_code).await;
unreachable!()
}
/// Exits the current instance of the app then relaunches it.
#[inline(always)]
pub fn relaunch() {
inner::relaunch();
}
mod inner {
use wasm_bindgen::prelude::*;
#[wasm_bindgen(module = "/src/process.js")]
extern "C" {
pub async fn exit(exitCode: i32);
pub fn relaunch();
}
}