firewheel-web-audio 0.4.0

A multi-threaded Web Audio backend for Firewheel
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use core::fmt::Display;
use wasm_bindgen::JsValue;

pub trait JsContext<T> {
    fn context(self, context: impl Display) -> Result<T, String>;
}

impl<T> JsContext<T> for Result<T, JsValue> {
    fn context(self, context: impl Display) -> Result<T, String> {
        self.map_err(|e| format!("Error: {context}: {e:?}"))
    }
}