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 checked;
13pub mod config;
14pub mod const_interpreter_loop;
15pub mod error;
16pub mod interop;
17mod interpreter_loop;
18pub mod linker;
19pub(crate) mod little_endian;
20pub mod resumable;
21pub mod store;
22pub mod value;
23pub mod value_stack;
24
25pub fn host_function_wrapper<Params: InteropValueList, Results: InteropValueList>(
43 params: Vec<Value>,
44 f: impl FnOnce(Params) -> Result<Results, HaltExecutionError>,
45) -> Result<Vec<Value>, HaltExecutionError> {
46 let params =
47 Params::try_from_values(params.into_iter()).expect("Params match the actual parameters");
48 f(params).map(Results::into_values)
49}