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:
-
Run the following command in the
src-tauri
folder to add the plugin to the project’s dependencies inCargo.toml
: -
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 the Capabilities Overview for more information and the step by step guide to use plugin permissions.
Default Permission
This permission set configures what kind of operations are available from the store plugin.
Granted Permissions
All operations are enabled by default.
allow-clear
allow-delete
allow-entries
allow-get
allow-has
allow-keys
allow-length
allow-load
allow-reset
allow-save
allow-set
allow-values
Permission Table
Identifier | Description |
---|---|
|
Enables the clear command without any pre-configured scope. |
|
Denies the clear command without any pre-configured scope. |
|
Enables the delete command without any pre-configured scope. |
|
Denies the delete command without any pre-configured scope. |
|
Enables the entries command without any pre-configured scope. |
|
Denies the entries command without any pre-configured scope. |
|
Enables the get command without any pre-configured scope. |
|
Denies the get command without any pre-configured scope. |
|
Enables the has command without any pre-configured scope. |
|
Denies the has command without any pre-configured scope. |
|
Enables the keys command without any pre-configured scope. |
|
Denies the keys command without any pre-configured scope. |
|
Enables the length command without any pre-configured scope. |
|
Denies the length command without any pre-configured scope. |
|
Enables the load command without any pre-configured scope. |
|
Denies the load command without any pre-configured scope. |
|
Enables the reset command without any pre-configured scope. |
|
Denies the reset command without any pre-configured scope. |
|
Enables the save command without any pre-configured scope. |
|
Denies the save command without any pre-configured scope. |
|
Enables the set command without any pre-configured scope. |
|
Denies the set command without any pre-configured scope. |
|
Enables the values command without any pre-configured scope. |
|
Denies the values command without any pre-configured scope. |
© 2024 Tauri Contributors. CC-BY / MIT