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

Method call

crates/wasmtime/src/runtime/component/func.rs:233–243  ·  view source on GitHub ↗

Invokes this function with the `params` given and returns the result. The `params` provided must match the parameters that this function takes in terms of their types and the number of parameters. Results will be written to the `results` slice provided if the call completes successfully. The initial types of the values in `results` are ignored and values are overwritten to write the result. It's

(
        &self,
        mut store: impl AsContextMut,
        params: &[Val],
        results: &mut [Val],
    )

Source from the content-addressed store, hash-verified

231 ///
232 /// Panics if `store` does not own this function.
233 pub fn call(
234 &self,
235 mut store: impl AsContextMut,
236 params: &[Val],
237 results: &mut [Val],
238 ) -> Result<()> {
239 let mut store = store.as_context_mut();
240 store.0.validate_sync_call()?;
241 self.call_impl(store.as_context_mut(), params, results)?;
242 Ok(())
243 }
244
245 /// Exactly like [`Self::call`] except for use on async stores.
246 ///

Callers

nothing calls this directly

Calls 4

OkFunction · 0.85
validate_sync_callMethod · 0.80
as_context_mutMethod · 0.45
call_implMethod · 0.45

Tested by

no test coverage detected