1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
pub mod metering;
use super::super::engine::wasm_config_t;
use std::sync::Arc;
use wasmer::ModuleMiddleware;
#[cfg(all(feature = "middlewares", not(feature = "compiler")))]
compile_error!("The `middlewares` feature requires the `compiler` feature to be turned on");
#[derive(Debug)]
#[allow(non_camel_case_types)]
pub struct wasmer_middleware_t {
pub(in crate::wasm_c_api) inner: Arc<dyn ModuleMiddleware>,
}
#[no_mangle]
pub extern "C" fn wasm_config_push_middleware(
config: &mut wasm_config_t,
middleware: Box<wasmer_middleware_t>,
) {
config.middlewares.push(*middleware);
}