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

Method run

examples/wasip2-plugins/src/main.rs:36–41  ·  view source on GitHub ↗
(self, state: &mut CalculatorState)

Source from the content-addressed store, hash-verified

34
35impl BinaryOperation {
36 fn run(self, state: &mut CalculatorState) -> wasmtime::Result<()> {
37 let desc = lookup_plugin(state, self.op.as_ref())?;
38 let result = desc.plugin.call_evaluate(&mut desc.store, self.x, self.y)?;
39 println!("{}({}, {}) = {}", self.op, self.x, self.y, result);
40 Ok(())
41 }
42}
43
44pub struct CalculatorState {

Callers 1

mainFunction · 0.45

Calls 3

lookup_pluginFunction · 0.85
OkFunction · 0.85
as_refMethod · 0.45

Tested by

no test coverage detected