wasmer_c_api/wasm_c_api/unstable/middlewares/
mod.rs

1//! Unstable non-standard Wasmer-specific types to manipulate module
2//! middlewares.
3
4pub mod metering;
5
6use std::sync::Arc;
7use wasmer_api::sys::ModuleMiddleware;
8
9#[cfg(all(feature = "middlewares", not(feature = "compiler")))]
10compile_error!("The `middlewares` feature requires the `compiler` feature to be turned on");
11
12/// Opaque representing any kind of middleware.
13///
14/// Used by `wasm_config_push_middleware`. A specific middleware is
15/// transformed into this type to get a generic middleware. See for
16/// example
17/// [`wasmer_metering_as_middleware`][metering::wasmer_metering_as_middleware].
18#[derive(Debug)]
19#[allow(non_camel_case_types)]
20pub struct wasmer_middleware_t {
21    pub(in crate::wasm_c_api) inner: Arc<dyn ModuleMiddleware>,
22}