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

Function lookup_plugin

examples/wasip2-plugins/src/main.rs:25–33  ·  view source on GitHub ↗
(
    state: &'a mut CalculatorState,
    op: &str,
)

Source from the content-addressed store, hash-verified

23}
24
25fn lookup_plugin<'a>(
26 state: &'a mut CalculatorState,
27 op: &str,
28) -> wasmtime::Result<&'a mut PluginDesc> {
29 state
30 .plugin_descs
31 .get_mut(op)
32 .ok_or(format_err!("unknown operation {}", op))
33}
34
35impl BinaryOperation {
36 fn run(self, state: &mut CalculatorState) -> wasmtime::Result<()> {

Callers 1

runMethod · 0.85

Calls 1

get_mutMethod · 0.45

Tested by

no test coverage detected