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:
Jonas Kruckenberg 2022-11-19 20:33:06 +01:00 committed by GitHub
parent 300fe18d22
commit e28a0bb749
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 655 additions and 289 deletions

25
src/error.rs Normal file
View 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))
}
}