feat: improve DX of events (#12)
* feat: improve DX of events * Update global_shortcut.rs * Update event.rs * deploy docs to gh pages * Delete rustdoc.yml * add tests for global shortcut * improve logs produced by tauri_log * wip docs * update docs * move error to separate module * feat: simplify functions returning array backed iterators * rebase and cleanup * fixes
This commit is contained in:
parent
300fe18d22
commit
e28a0bb749
18 changed files with 655 additions and 289 deletions
25
src/error.rs
Normal file
25
src/error.rs
Normal file
|
@ -0,0 +1,25 @@
|
|||
use wasm_bindgen::JsValue;
|
||||
|
||||
|
||||
#[derive(Clone, Eq, PartialEq, Debug, thiserror::Error)]
|
||||
pub enum Error {
|
||||
#[error("TODO.")]
|
||||
Binding(String),
|
||||
#[error("TODO.")]
|
||||
Serde(String),
|
||||
#[cfg(any(feature = "event", feature = "window"))]
|
||||
#[error("TODO.")]
|
||||
OneshotCanceled(#[from] futures::channel::oneshot::Canceled)
|
||||
}
|
||||
|
||||
impl From<serde_wasm_bindgen::Error> for Error {
|
||||
fn from(e: serde_wasm_bindgen::Error) -> Self {
|
||||
Self::Serde(e.to_string())
|
||||
}
|
||||
}
|
||||
|
||||
impl From<JsValue> for Error {
|
||||
fn from(e: JsValue) -> Self {
|
||||
Self::Binding(format!("{:?}", e))
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue