mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-09-22 21:30:44 +02:00
feat(store): expose Store to Rust code (#108)
* feat(store): expose Store to Rust code in a meaningful way * manually implement Default to improve generic inference * update readme * rename method * make error Send and Sync * make `use_store` more ergonomic * export JsonValue * fix readme example * fmt --------- Co-authored-by: FabianLars <fabianlars@fabianlars.de>
This commit is contained in:
co-authored by
FabianLars
parent
6d7b985b46
commit
d4223f6fd2
@@ -10,9 +10,9 @@ use std::path::PathBuf;
|
||||
#[non_exhaustive]
|
||||
pub enum Error {
|
||||
#[error("Failed to serialize store. {0}")]
|
||||
Serialize(Box<dyn std::error::Error>),
|
||||
Serialize(Box<dyn std::error::Error + Send + Sync>),
|
||||
#[error("Failed to deserialize store. {0}")]
|
||||
Deserialize(Box<dyn std::error::Error>),
|
||||
Deserialize(Box<dyn std::error::Error + Send + Sync>),
|
||||
/// JSON error.
|
||||
#[error(transparent)]
|
||||
Json(#[from] serde_json::Error),
|
||||
@@ -22,6 +22,9 @@ pub enum Error {
|
||||
/// Store not found
|
||||
#[error("Store \"{0}\" not found")]
|
||||
NotFound(PathBuf),
|
||||
/// Some Tauri API failed
|
||||
#[error(transparent)]
|
||||
Tauri(#[from] tauri::Error),
|
||||
}
|
||||
|
||||
impl Serialize for Error {
|
||||
|
||||
Reference in New Issue
Block a user