1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
//! # Ark module crate
//!
//! This crate is used at the root level the for building Ark Wasm module binaries.
//! It should not be depended on and used by library crates.
//!
//! Also see the [🗺️ Ark Developer Guide](https://ark.embark.dev/api/ark_api/)

// crate-specific exceptions:
#![deny(
    missing_docs,
    rustdoc::broken_intra_doc_links,
    rustdoc::private_intra_doc_links,
    rustdoc::missing_crate_level_docs
)]
#![forbid(clippy::not_unsafe_ptr_arg_deref)]

#[cfg(target_arch = "wasm32")]
mod types {
    pub mod applet;
    pub mod audio;
    #[cfg(feature = "behavior")]
    pub mod behavior;
    pub mod cmdlet;
    pub mod render;
    #[cfg(feature = "unstable-servlet")]
    pub mod servlet;
}
#[cfg(target_arch = "wasm32")]
pub use types::*;

mod alloc;
#[cfg(target_arch = "wasm32")]
mod log;
#[cfg(target_arch = "wasm32")]
mod panic;

// This is public so the internal macros can access it
#[doc(hidden)]
#[cfg(target_arch = "wasm32")]
pub mod util;

#[cfg(feature = "with_async")]
mod runtime;
#[cfg(feature = "with_async")]
pub use runtime::*;

/// Initialize the module
#[cfg(target_arch = "wasm32")]
pub fn init() {
    log::LOG.activate();
}

// Export log crate macro so we can use it in our own macro
#[doc(hidden)]
pub use ::log::error;
// Export so we can us it in our macros
#[doc(hidden)]
pub use ark_api_ffi::ErrorCode;