Download packages/tauri-plugins/plugins/store/src/error.rs from echodict/readest: direct link, hf CLI and curl.
- Browser
- Download file 1.38 kB
-
https://huggingface.co/datasets/echodict/readest/resolve/main/packages/tauri-plugins/plugins/store/src/error.rs
- Command line
-
hf download hf://datasets/echodict/readest/packages/tauri-plugins/plugins/store/src/error.rs
-
curl -L -o error.rs https://huggingface.co/datasets/echodict/readest/resolve/main/packages/tauri-plugins/plugins/store/src/error.rs
1.38 kB
| // Copyright 2019-2023 Tauri Programme within The Commons Conservancy | |
| // SPDX-License-Identifier: Apache-2.0 | |
| // SPDX-License-Identifier: MIT | |
| use serde::{Serialize, Serializer}; | |
| pub type Result<T> = std::result::Result<T, Error>; | |
| /// The error types. | |
| pub enum Error { | |
| Serialize(Box<dyn std::error::Error + Send + Sync>), | |
| Deserialize(Box<dyn std::error::Error + Send + Sync>), | |
| /// JSON error. | |
| Json( serde_json::Error), | |
| /// IO error. | |
| Io( std::io::Error), | |
| // /// Store already exists | |
| // #[error("Store at \"{0}\" already exists")] | |
| // AlreadyExists(PathBuf), | |
| /// Serialize function not found | |
| SerializeFunctionNotFound(String), | |
| /// Deserialize function not found | |
| DeserializeFunctionNotFound(String), | |
| /// Some Tauri API failed | |
| Tauri( tauri::Error), | |
| } | |
| impl Serialize for Error { | |
| fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error> | |
| where | |
| S: Serializer, | |
| { | |
| serializer.serialize_str(self.to_string().as_ref()) | |
| } | |
| } | |