|
8 | 8 | //! |
9 | 9 | //! # Cargo features |
10 | 10 | //! |
11 | | -//! The following are a list of Cargo features that can be enabled or disabled: |
| 11 | +//! The following are a list of [Cargo features](https://doc.rust-lang.org/stable/cargo/reference/manifest.html#the-features-section) that can be enabled or disabled: |
12 | 12 | //! |
13 | 13 | //! - **wry** *(enabled by default)*: Enables the [wry](https://github.com/tauri-apps/wry) runtime. Only disable it if you want a custom runtime. |
| 14 | +//! - **custom-protocol**: Feature managed by the Tauri CLI. When enabled, Tauri assumes a production environment instead of a development one. |
| 15 | +//! - **updater**: Enables the application auto updater. Enabled by default if the `updater` config is defined on the `tauri.conf.json` file. |
| 16 | +//! - **http-api**: Enables the [`api::http`] module. |
14 | 17 | //! - **reqwest-client**: Uses `reqwest` as HTTP client on the `http` APIs. Improves performance, but increases the bundle size. |
| 18 | +//! - **command**: Enables the [`api::process::Command`] APIs. |
| 19 | +//! - **dialog**: Enables the [`api::dialog`] module. |
| 20 | +//! - **notification**: Enables the [`api::notification`] module. |
15 | 21 | //! - **cli**: Enables usage of `clap` for CLI argument parsing. Enabled by default if the `cli` config is defined on the `tauri.conf.json` file. |
16 | 22 | //! - **system-tray**: Enables application system tray API. Enabled by default if the `systemTray` config is defined on the `tauri.conf.json` file. |
17 | 23 | //! - **macos-private-api**: Enables features only available in **macOS**'s private APIs, currently the `transparent` window functionality and the `fullScreenEnabled` preference setting to `true`. Enabled by default if the `tauri > macosPrivateApi` config flag is set to `true` on the `tauri.conf.json` file. |
18 | | -//! - **updater**: Enables the application auto updater. Enabled by default if the `updater` config is defined on the `tauri.conf.json` file. |
19 | | -//! - **egui**: Enables method to create a native egui window. This can be used for creating native |
20 | | -//! OpenGL contexts or [egui](https://github.com/emilk/egui) widgets. |
| 24 | +//! - **egui**: Enables method to create a native egui window. This can be used for creating native OpenGL contexts or [egui](https://github.com/emilk/egui) widgets. |
| 25 | +//! |
| 26 | +//! ## Cargo allowlist features |
| 27 | +//! |
| 28 | +//! The following are a list of [Cargo features](https://doc.rust-lang.org/stable/cargo/reference/manifest.html#the-features-section) that enables commands for Tauri's API package. |
| 29 | +//! These features are automatically enabled by the Tauri CLI based on the `allowlist` configuration under `tauri.conf.json`. |
| 30 | +//! |
| 31 | +//! - **api-all**: Enables all API endpoints. |
| 32 | +//! |
| 33 | +//! ### Clipboard allowlist |
| 34 | +//! |
| 35 | +//! - **clipboard-all**: Enables all [Clipboard APIs](https://tauri.studio/en/docs/api/js/modules/clipboard/). |
| 36 | +//! - **clipboard-read-text**: Enables the [`readText` API](https://tauri.studio/en/docs/api/js/modules/clipboard/#readtext). |
| 37 | +//! - **clipboard-write-text**: Enables the [`writeText` API](https://tauri.studio/en/docs/api/js/modules/clipboard/#writetext). |
| 38 | +//! |
| 39 | +//! ### Dialog allowlist |
| 40 | +//! |
| 41 | +//! - **dialog-all**: Enables all [Dialog APIs](https://tauri.studio/en/docs/api/js/modules/dialog). |
| 42 | +//! - **dialog-ask**: Enables the [`ask` API](https://tauri.studio/en/docs/api/js/modules/dialog#ask). |
| 43 | +//! - **dialog-confirm**: Enables the [`confirm` API](https://tauri.studio/en/docs/api/js/modules/dialog#confirm). |
| 44 | +//! - **dialog-message**: Enables the [`message` API](https://tauri.studio/en/docs/api/js/modules/dialog#message). |
| 45 | +//! - **dialog-open**: Enables the [`open` API](https://tauri.studio/en/docs/api/js/modules/dialog#open). |
| 46 | +//! - **dialog-save**: Enables the [`save` API](https://tauri.studio/en/docs/api/js/modules/dialog#save). |
| 47 | +//! |
| 48 | +//! ### Filesystem allowlist |
| 49 | +//! |
| 50 | +//! - **fs-all**: Enables all [Filesystem APIs](https://tauri.studio/en/docs/api/js/modules/fs). |
| 51 | +//! - **fs-copy-file**: Enables the [`copyFile` API](https://tauri.studio/en/docs/api/js/modules/fs#copyfile). |
| 52 | +//! - **fs-create-dir**: Enables the [`createDir` API](https://tauri.studio/en/docs/api/js/modules/fs#createdir). |
| 53 | +//! - **fs-read-binary-file**: Enables the [`readBinaryFile` API](https://tauri.studio/en/docs/api/js/modules/fs#readbinaryfile). |
| 54 | +//! - **fs-read-dir**: Enables the [`readDir` API](https://tauri.studio/en/docs/api/js/modules/fs#readdir). |
| 55 | +//! - **fs-read-text-file**: Enables the [`readTextFile` API](https://tauri.studio/en/docs/api/js/modules/fs#readtextfile). |
| 56 | +//! - **fs-remove-dir**: Enables the [`removeDir` API](https://tauri.studio/en/docs/api/js/modules/fs#removedir). |
| 57 | +//! - **fs-remove-file**: Enables the [`removeFile` API](https://tauri.studio/en/docs/api/js/modules/fs#removefile). |
| 58 | +//! - **fs-rename-file**: Enables the [`renameFile` API](https://tauri.studio/en/docs/api/js/modules/fs#renamefile). |
| 59 | +//! - **fs-write-binary-file**: Enables the [`writeBinaryFile` API](https://tauri.studio/en/docs/api/js/modules/fs#writebinaryfile). |
| 60 | +//! - **fs-write-file**: Enables the [`writeFile` API](https://tauri.studio/en/docs/api/js/modules/fs#writefile). |
| 61 | +//! |
| 62 | +//! ### Global shortcut allowlist |
| 63 | +//! |
| 64 | +//! - **global-shortcut-all**: Enables all [GlobalShortcut APIs](https://tauri.studio/en/docs/api/js/modules/globalShortcut). |
| 65 | +//! |
| 66 | +//! ### HTTP allowlist |
| 67 | +//! |
| 68 | +//! - **http-all**: Enables all [HTTP APIs](https://tauri.studio/en/docs/api/js/modules/http). |
| 69 | +//! - **http-request**: Enables the [`request` APIs](https://tauri.studio/en/docs/api/js/classes/http.client/). |
| 70 | +//! |
| 71 | +//! ### Notification allowlist |
| 72 | +//! |
| 73 | +//! - **notification-all**: Enables all [Notification APIs](https://tauri.studio/en/docs/api/js/modules/notification). |
| 74 | +//! |
| 75 | +//! ### OS allowlist |
| 76 | +//! |
| 77 | +//! - **os-all**: Enables all [OS APIs](https://tauri.studio/en/docs/api/js/modules/os). |
| 78 | +//! |
| 79 | +//! ### Path allowlist |
| 80 | +//! |
| 81 | +//! - **path-all**: Enables all [Path APIs](https://tauri.studio/en/docs/api/js/modules/path). |
| 82 | +//! |
| 83 | +//! ### Process allowlist |
| 84 | +//! |
| 85 | +//! - **process-all**: Enables all [Process APIs](https://tauri.studio/en/docs/api/js/modules/process). |
| 86 | +//! - **process-exit**: Enables the [`exit` API](https://tauri.studio/en/docs/api/js/modules/process#exit). |
| 87 | +//! - **process-relaunch**: Enables the [`relaunch` API](https://tauri.studio/en/docs/api/js/modules/process#relaunch). |
| 88 | +//! |
| 89 | +//! ### Protocol allowlist |
| 90 | +//! |
| 91 | +//! - **protocol-all**: Enables all Protocol APIs. |
| 92 | +//! - **protocol-asset**: Enables the `asset` custom protocol. |
| 93 | +//! |
| 94 | +//! ### Shell allowlist |
| 95 | +//! |
| 96 | +//! - **shell-all**: Enables all [Clipboard APIs](https://tauri.studio/en/docs/api/js/modules/shell). |
| 97 | +//! - **shell-execute**: Enables [executing arbitrary programs](https://tauri.studio/en/docs/api/js/classes/shell.Command#constructor). |
| 98 | +//! - **shell-sidecar**: Enables [executing a `sidecar` program](https://tauri.studio/en/docs/api/js/classes/shell.Command#sidecar). |
| 99 | +//! - **shell-open**: Enables the [`open` API](https://tauri.studio/en/docs/api/js/modules/shell#open). |
| 100 | +//! |
| 101 | +//! ### Window allowlist |
| 102 | +//! |
| 103 | +//! - **window-all**: Enables all [Window APIs](https://tauri.studio/en/docs/api/js/modules/window). |
| 104 | +//! - **window-create**: Enables the API used to [create new windows](https://tauri.studio/en/docs/api/js/classes/window.webviewwindow/). |
| 105 | +//! - **window-center**: Enables the [`center` API](https://tauri.studio/en/docs/api/js/classes/window.WebviewWindow#center). |
| 106 | +//! - **window-request-user-attention**: Enables the [`requestUserAttention` API](https://tauri.studio/en/docs/api/js/classes/window.WebviewWindow#requestuserattention). |
| 107 | +//! - **window-set-resizable**: Enables the [`setResizable` API](https://tauri.studio/en/docs/api/js/classes/window.WebviewWindow#setresizable). |
| 108 | +//! - **window-set-title**: Enables the [`setTitle` API](https://tauri.studio/en/docs/api/js/classes/window.WebviewWindow#settitle). |
| 109 | +//! - **window-maximize**: Enables the [`maximize` API](https://tauri.studio/en/docs/api/js/classes/window.WebviewWindow#maximize). |
| 110 | +//! - **window-unmaximize**: Enables the [`unmaximize` API](https://tauri.studio/en/docs/api/js/classes/window.WebviewWindow#unmaximize). |
| 111 | +//! - **window-minimize**: Enables the [`minimize` API](https://tauri.studio/en/docs/api/js/classes/window.WebviewWindow#minimize). |
| 112 | +//! - **window-unminimize**: Enables the [`unminimize` API](https://tauri.studio/en/docs/api/js/classes/window.WebviewWindow#unminimize). |
| 113 | +//! - **window-show**: Enables the [`show` API](https://tauri.studio/en/docs/api/js/classes/window.WebviewWindow#show). |
| 114 | +//! - **window-hide**: Enables the [`hide` API](https://tauri.studio/en/docs/api/js/classes/window.WebviewWindow#hide). |
| 115 | +//! - **window-close**: Enables the [`close` API](https://tauri.studio/en/docs/api/js/classes/window.WebviewWindow#close). |
| 116 | +//! - **window-set-decorations**: Enables the [`setDecorations` API](https://tauri.studio/en/docs/api/js/classes/window.WebviewWindow#setdecorations). |
| 117 | +//! - **window-set-always-on-top**: Enables the [`setAlwaysOnTop` API](https://tauri.studio/en/docs/api/js/classes/window.WebviewWindow#setalwaysontop). |
| 118 | +//! - **window-set-size**: Enables the [`setSize` API](https://tauri.studio/en/docs/api/js/classes/window.WebviewWindow#setsize). |
| 119 | +//! - **window-set-min-size**: Enables the [`setMinSize` API](https://tauri.studio/en/docs/api/js/classes/window.WebviewWindow#setminsize). |
| 120 | +//! - **window-set-max-size**: Enables the [`setMaxSize` API](https://tauri.studio/en/docs/api/js/classes/window.WebviewWindow#setmaxsize). |
| 121 | +//! - **window-set-position**: Enables the [`setPosition` API](https://tauri.studio/en/docs/api/js/classes/window.WebviewWindow#setposition). |
| 122 | +//! - **window-set-fullscreen**: Enables the [`setFullscreen` API](https://tauri.studio/en/docs/api/js/classes/window.WebviewWindow#setfullscreen). |
| 123 | +//! - **window-set-focus**: Enables the [`setFocus` API](https://tauri.studio/en/docs/api/js/classes/window.WebviewWindow#setfocus). |
| 124 | +//! - **window-set-icon**: Enables the [`setIcon` API](https://tauri.studio/en/docs/api/js/classes/window.WebviewWindow#seticon). |
| 125 | +//! - **window-set-skip-taskbar**: Enables the [`setSkipTaskbar` API](https://tauri.studio/en/docs/api/js/classes/window.WebviewWindow#setskiptaskbar). |
| 126 | +//! - **window-start-dragging**: Enables the [`startDragging` API](https://tauri.studio/en/docs/api/js/classes/window.WebviewWindow#startdragging). |
| 127 | +//! - **window-print**: Enables the [`print` API](https://tauri.studio/en/docs/api/js/classes/window.WebviewWindow#print). |
21 | 128 |
|
22 | 129 | #![warn(missing_docs, rust_2018_idioms)] |
23 | 130 | #![cfg_attr(doc_cfg, feature(doc_cfg))] |
@@ -153,7 +260,7 @@ macro_rules! tauri_build_context { |
153 | 260 | /// User supplied data required inside of a Tauri application. |
154 | 261 | /// |
155 | 262 | /// # Stability |
156 | | -/// This is the output of the `tauri::generate_context!` macro, and is not considered part of the stable API. |
| 263 | +/// This is the output of the [`generate_context`] macro, and is not considered part of the stable API. |
157 | 264 | /// Unless you know what you are doing and are prepared for this type to have breaking changes, do not create it yourself. |
158 | 265 | pub struct Context<A: Assets> { |
159 | 266 | pub(crate) config: Config, |
|
0 commit comments