1use alloc::vec::Vec;
2
3use const_interpreter_loop::run_const_span;
4use store::HaltExecutionError;
5use value_stack::Stack;
6
7use crate::execution::assert_validated::UnwrapValidatedExt;
8use crate::execution::value::Value;
9use crate::interop::InteropValueList;
10
11pub(crate) mod assert_validated;
12pub mod config;
13pub mod const_interpreter_loop;
14pub mod error;
15pub mod interop;
16mod interpreter_loop;
17pub mod linker;
18pub(crate) mod little_endian;
19pub mod resumable;
20pub mod store;
21pub mod value;
22pub mod value_stack;
23
24pub fn host_function_wrapper<Params: InteropValueList, Results: InteropValueList>(
42 params: Vec<Value>,
43 f: impl FnOnce(Params) -> Result<Results, HaltExecutionError>,
44) -> Result<Vec<Value>, HaltExecutionError> {
45 let params =
46 Params::try_from_values(params.into_iter()).expect("Params match the actual parameters");
47 f(params).map(Results::into_values)
48}