1#![warn(clippy::cast_possible_truncation)]
28
29#[macro_use]
30pub(crate) mod func;
31
32pub(crate) mod code;
33pub(crate) mod code_memory;
34#[cfg(feature = "debug")]
35pub(crate) mod debug;
36#[cfg(feature = "gc")]
37pub(crate) mod exception;
38pub(crate) mod externals;
39#[cfg(feature = "async")]
40pub(crate) mod fiber;
41pub(crate) mod gc;
42pub(crate) mod instance;
43pub(crate) mod instantiate;
44pub(crate) mod limits;
45pub(crate) mod linker;
46pub(crate) mod memory;
47pub(crate) mod module;
48#[cfg(feature = "debug-builtins")]
49pub(crate) mod native_debug;
50pub(crate) mod resources;
51pub(crate) mod store;
52pub(crate) mod trampoline;
53pub(crate) mod trap;
54pub(crate) mod type_registry;
55pub(crate) mod types;
56pub(crate) mod v128;
57pub(crate) mod values;
58pub(crate) mod vm;
59
60#[cfg(feature = "component-model")]
61pub mod component;
62
63cfg_if::cfg_if! {
64 if #[cfg(miri)] {
65 } else if #[cfg(not(feature = "std"))] {
67 } else if #[cfg(unix)] {
69 pub mod unix;
70 } else if #[cfg(windows)] {
71 pub mod windows;
72 } else {
73 }
75}
76
77pub use code_memory::CodeMemory;
78#[cfg(feature = "debug")]
79pub use debug::*;
80#[cfg(feature = "gc")]
81pub use exception::*;
82pub use externals::*;
83pub use func::*;
84pub use gc::*;
85pub use instance::{Instance, InstancePre};
86pub use instantiate::CompiledModule;
87pub use limits::*;
88pub use linker::*;
89pub use memory::*;
90pub use module::{Module, ModuleExport};
91pub use resources::*;
92#[cfg(all(feature = "async", feature = "call-hook"))]
93pub use store::CallHookHandler;
94pub use store::{
95 AsContext, AsContextMut, CallHook, Store, StoreContext, StoreContextMut, UpdateDeadline,
96};
97pub use trap::*;
98pub use types::*;
99pub use v128::V128;
100pub use values::*;
101
102#[cfg(feature = "pooling-allocator")]
103pub use vm::{PoolConcurrencyLimitError, PoolingAllocatorMetrics};
104
105#[cfg(feature = "profiling")]
106mod profiling;
107#[cfg(feature = "profiling")]
108pub use profiling::GuestProfiler;
109
110#[cfg(feature = "async")]
111pub(crate) mod stack;
112#[cfg(feature = "async")]
113pub use stack::*;
114
115#[cfg(feature = "coredump")]
116mod coredump;
117#[cfg(feature = "coredump")]
118pub use coredump::*;
119
120#[cfg(feature = "wave")]
121mod wave;
122
123fn _assertions_runtime() {
124 use crate::_assert_send_and_sync;
125
126 #[cfg(feature = "async")]
127 fn _assert_send<T: Send>(_t: T) {}
128
129 _assert_send_and_sync::<Caller<'_, ()>>();
130 _assert_send_and_sync::<ExternRef>();
131 _assert_send_and_sync::<(Func, TypedFunc<(), ()>, Global, Table, Memory)>();
132 _assert_send_and_sync::<Instance>();
133 _assert_send_and_sync::<InstancePre<()>>();
134 _assert_send_and_sync::<InstancePre<*mut u8>>();
135 _assert_send_and_sync::<Linker<()>>();
136 _assert_send_and_sync::<Linker<*mut u8>>();
137 _assert_send_and_sync::<Module>();
138 _assert_send_and_sync::<Store<()>>();
139 _assert_send_and_sync::<StoreContext<'_, ()>>();
140 _assert_send_and_sync::<StoreContextMut<'_, ()>>();
141
142 #[cfg(feature = "async")]
143 fn _call_async(s: &mut Store<()>, f: Func) {
144 _assert_send(f.call_async(&mut *s, &[], &mut []))
145 }
146 #[cfg(feature = "async")]
147 fn _typed_call_async(s: &mut Store<()>, f: TypedFunc<(), ()>) {
148 _assert_send(f.call_async(&mut *s, ()))
149 }
150 #[cfg(feature = "async")]
151 fn _instantiate_async(s: &mut Store<()>, m: &Module) {
152 _assert_send(Instance::new_async(s, m, &[]))
153 }
154}