ambient_sys/
lib.rs

1pub mod control;
2mod missed_tick;
3pub mod task;
4pub mod time;
5
6pub use missed_tick::MissedTickBehavior;
7
8/// Sets a panic hook which prints panics to the browser dev-console
9pub fn set_panic_hook() {
10    // When the `console_error_panic_hook` feature is enabled, we can call the
11    // `set_panic_hook` function at least once during initialization, and then
12    // we will get better error messages if our code ever panics.
13    //
14    // For more details see
15    // https://github.com/rustwasm/console_error_panic_hook#readme
16    #[cfg(all(target_os = "unknown", feature = "console_error_panic_hook"))]
17    {
18        tracing::info!("Setting panic hook");
19        console_error_panic_hook::set_once();
20    }
21}
22
23#[cfg_attr(not(target_os = "unknown"), path = "./native/mod.rs")]
24#[cfg_attr(target_os = "unknown", path = "./wasm/mod.rs")]
25pub(crate) mod platform;
26
27pub use platform::clipboard;
28/// Platform agnostic file io.
29///
30/// **Note**: wasm file io always return Err, but do *not* panic.
31pub use platform::fs;