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