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