tauri_plugin_process/lib.rs
1// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
2// SPDX-License-Identifier: Apache-2.0
3// SPDX-License-Identifier: MIT
4
5//! This plugin provides APIs to access the current process. To spawn child processes, see the [`shell`](https://github.com/tauri-apps/tauri-plugin-shell) plugin.
6
7#![doc(
8 html_logo_url = "https://github.com/tauri-apps/tauri/raw/dev/app-icon.png",
9 html_favicon_url = "https://github.com/tauri-apps/tauri/raw/dev/app-icon.png"
10)]
11
12use tauri::{
13 Runtime,
14 plugin::{Builder, TauriPlugin},
15};
16
17mod commands;
18
19/// Initializes the plugin, exposing commands to exit or restart the current process.
20pub fn init<R: Runtime>() -> TauriPlugin<R> {
21 Builder::new("process")
22 .invoke_handler(tauri::generate_handler![commands::exit, commands::restart])
23 .build()
24}