tauri-wasm 0.2.0

The tauri framework library for pure rust frontend
Documentation
use {
    crate::ext,
    std::{error, fmt},
    wasm_bindgen::JsValue,
};

/// Common error type.
#[derive(Debug)]
pub struct Error(pub(crate) JsValue);

impl fmt::Display for Error {
    #[inline]
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        ext::to_string(&self.0).fmt(f)
    }
}

impl error::Error for Error {}

impl From<Error> for JsValue {
    #[inline]
    fn from(e: Error) -> Self {
        e.0
    }
}