Implemented fs
module (#19)
This commit is contained in:
parent
36c873b825
commit
55fe1d144f
7 changed files with 535 additions and 13 deletions
|
@ -1,6 +1,6 @@
|
|||
use std::path::PathBuf;
|
||||
use wasm_bindgen::JsValue;
|
||||
|
||||
|
||||
#[derive(Clone, Eq, PartialEq, Debug, thiserror::Error)]
|
||||
pub enum Error {
|
||||
#[error("JS Binding: {0}")]
|
||||
|
@ -9,7 +9,10 @@ pub enum Error {
|
|||
Serde(String),
|
||||
#[cfg(any(feature = "event", feature = "window"))]
|
||||
#[error("Oneshot cancelled: {0}")]
|
||||
OneshotCanceled(#[from] futures::channel::oneshot::Canceled)
|
||||
OneshotCanceled(#[from] futures::channel::oneshot::Canceled),
|
||||
#[cfg(feature = "fs")]
|
||||
#[error("could not convert path to string")]
|
||||
Utf8(PathBuf),
|
||||
}
|
||||
|
||||
impl From<serde_wasm_bindgen::Error> for Error {
|
||||
|
@ -22,4 +25,4 @@ 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