car_mirror_wasm/
lib.rs

1//! # car-mirror-wasm
2//!
3//! This crate exposes wasm bindings to car-mirror *client* functions.
4
5#![cfg_attr(docsrs, feature(doc_cfg))]
6#![warn(missing_docs, rust_2018_idioms)]
7#![deny(unreachable_pub)]
8#![cfg(target_arch = "wasm32")]
9
10/// A `BlockStore` implementation based on a JS interface
11pub mod blockstore;
12/// Bindings to the request and response messages used in car mirror
13pub mod messages;
14
15mod exports;
16mod utils;
17
18pub use exports::*;
19
20//------------------------------------------------------------------------------
21// Utilities
22//------------------------------------------------------------------------------
23
24/// Panic hook lets us get better error messages if our Rust code ever panics.
25///
26/// For more details see
27/// <https://github.com/rustwasm/console_error_panic_hook#readme>
28#[wasm_bindgen::prelude::wasm_bindgen(js_name = "setPanicHook")]
29pub fn set_panic_hook() {
30    #[cfg(feature = "console_error_panic_hook")]
31    console_error_panic_hook::set_once();
32}