ark_module/
lib.rs

1//! # Ark module crate
2//!
3//! This crate is used at the root level the for building Ark Wasm module binaries.
4//! It should not be depended on and used by library crates.
5//!
6//! Also see the [🗺️ Ark Developer Guide](https://ark.embark.dev/api/ark_api/)
7
8// crate-specific exceptions:
9#![allow(unsafe_code)]
10#![deny(
11    missing_docs,
12    rustdoc::broken_intra_doc_links,
13    rustdoc::private_intra_doc_links,
14    rustdoc::missing_crate_level_docs
15)]
16#![forbid(clippy::not_unsafe_ptr_arg_deref)]
17
18#[cfg(target_arch = "wasm32")]
19mod types {
20    pub mod applet;
21    pub mod audio;
22    #[cfg(feature = "behavior")]
23    pub mod behavior;
24    pub mod cmdlet;
25    pub mod render;
26}
27#[cfg(target_arch = "wasm32")]
28pub use types::*;
29
30mod alloc;
31#[cfg(target_arch = "wasm32")]
32mod log;
33#[cfg(target_arch = "wasm32")]
34mod panic;
35
36// This is public so the internal macros can access it
37#[doc(hidden)]
38#[cfg(target_arch = "wasm32")]
39pub mod util;
40
41#[cfg(feature = "with_async")]
42mod runtime;
43#[cfg(feature = "with_async")]
44pub use runtime::*;
45
46/// Initialize the module
47#[cfg(target_arch = "wasm32")]
48pub fn init() {
49    log::LOG.activate();
50}
51
52// Export log crate macro so we can use it in our own macro
53#[doc(hidden)]
54pub use ::log::error;
55// Export so we can us it in our macros
56#[doc(hidden)]
57pub use ark_api_ffi::ErrorCode;