diff --git a/src/module/mod.rs b/src/module/mod.rs index 3994876e..6069b1e5 100644 --- a/src/module/mod.rs +++ b/src/module/mod.rs @@ -129,6 +129,11 @@ impl Module { ModuleConfig::new().parse(wasm) } + /// Construct a new module from the in-memory wasm buffer and configuration. + pub fn from_buffer_with_config(wasm: &[u8], config: &ModuleConfig) -> Result { + config.parse(wasm) + } + fn parse(wasm: &[u8], config: &ModuleConfig) -> Result { let mut ret = Module { config: config.clone(),