Store
This plugin provides a persistent key-value store. This is one of many options to handle state in your application. See the state management overview for more information on additional options.
This store will allow you to persist state to a file which can be saved and loaded on demand including between app restarts. Note that this process is asynchronous which will require handling it within your code. It can be used both in the webview or within Rust.
Supported Platforms
- Windows
- Linux
- macOS
- Android
- iOS
Setup
Install the store plugin to get started.
Use your project’s package manager to add the dependency:
-
Install the store plugin by adding the following to your
Cargo.toml
file: -
Modify
lib.rs
to initialize the plugin: -
Install the JavaScript Guest bindings using your preferred JavaScript package manager:
Usage
Permissions
By default, all plugin commands are blocked and cannot be accessed. You must define a list of permissions in your capabilities
configuration.
See Permissions Overview for more information.
Permission | Description |
---|---|
store:allow-clear | Enables the clear command without any pre-configured scope. |
store:deny-clear | Denies the clear command without any pre-configured scope. |
store:allow-delete | Enables the delete command without any pre-configured scope. |
store:deny-delete | Denies the delete command without any pre-configured scope. |
store:allow-entries | Enables the entries command without any pre-configured scope. |
store:deny-entries | Denies the entries command without any pre-configured scope. |
store:allow-get | Enables the get command without any pre-configured scope. |
store:deny-get | Denies the get command without any pre-configured scope. |
store:allow-has | Enables the has command without any pre-configured scope. |
store:deny-has | Denies the has command without any pre-configured scope. |
store:allow-keys | Enables the keys command without any pre-configured scope. |
store:deny-keys | Denies the keys command without any pre-configured scope. |
store:allow-length | Enables the length command without any pre-configured scope. |
store:deny-length | Denies the length command without any pre-configured scope. |
store:allow-load | Enables the load command without any pre-configured scope. |
store:deny-load | Denies the load command without any pre-configured scope. |
store:allow-reset | Enables the reset command without any pre-configured scope. |
store:deny-reset | Denies the reset command without any pre-configured scope. |
store:allow-save | Enables the save command without any pre-configured scope. |
store:deny-save | Denies the save command without any pre-configured scope. |
store:allow-set | Enables the set command without any pre-configured scope. |
store:deny-set | Denies the set command without any pre-configured scope. |
store:allow-values | Enables the values command without any pre-configured scope. |
store:deny-values | Denies the values command without any pre-configured scope. |
© 2024 Tauri Contributors. CC-BY / MIT