MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / new_engine

Method new_engine

src/commands/run.rs:325–343  ·  view source on GitHub ↗

Creates a new `Engine` with the configuration for this command.

(&mut self)

Source from the content-addressed store, hash-verified

323
324 /// Creates a new `Engine` with the configuration for this command.
325 pub fn new_engine(&mut self) -> Result<Engine> {
326 let mut config = self.run.common.config(None)?;
327
328 if self.run.common.wasm.timeout.is_some() {
329 config.epoch_interruption(true);
330 }
331 match self.run.profile {
332 Some(Profile::Native(s)) => {
333 config.profiler(s);
334 }
335 Some(Profile::Guest { .. }) => {
336 // Further configured down below as well.
337 config.epoch_interruption(true);
338 }
339 None => {}
340 }
341
342 Engine::new(&config)
343 }
344
345 /// Populates a new `Store` and `CliLinker` with the configuration in this
346 /// command.

Callers 3

serve_under_debuggerMethod · 0.80
execute_asyncMethod · 0.80
executeMethod · 0.80

Calls 5

newFunction · 0.50
configMethod · 0.45
is_someMethod · 0.45
epoch_interruptionMethod · 0.45
profilerMethod · 0.45

Tested by

no test coverage detected