bolic-network 0.0.1

Modern network abstraction and tooling for building distributed systems
Documentation
#[cfg(target_arch = "wasm32")]
pub mod wasm {
    use wasm_bindgen::prelude::*;
    #[wasm_bindgen]
    extern "C" {
        #[wasm_bindgen(js_namespace = console)]
        pub fn log(s: &str);
    }
    #[macro_export]
    macro_rules! console_log {
        // Note that this is using the `log` function imported above during
        // `bare_bones`
        ($($t:tt)*) => (crate::hub::utils::wasm::log(&format_args!($($t)*).to_string()))
    }

    pub fn to_js_error(e: impl std::fmt::Debug) -> JsValue {
        JsValue::from(format!("error: {:?}", e))
    }
}

#[cfg(target_arch = "wasm32")] pub use wasm::to_js_error;

pub use tracing::{debug, error, info, warn};