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

Function error_from_panic

crates/c-api/src/func.rs:171–179  ·  view source on GitHub ↗
(panic: Box<dyn Any + Send>)

Source from the content-addressed store, hash-verified

169}
170
171fn error_from_panic(panic: Box<dyn Any + Send>) -> Error {
172 if let Some(msg) = panic.downcast_ref::<String>() {
173 Error::msg(msg.clone())
174 } else if let Some(msg) = panic.downcast_ref::<&'static str>() {
175 Error::msg(*msg)
176 } else {
177 Error::msg("rust panic happened")
178 }
179}
180
181#[unsafe(no_mangle)]
182pub unsafe extern "C" fn wasm_func_type(f: &wasm_func_t) -> Box<wasm_functype_t> {

Callers 2

wasm_func_callFunction · 0.85
wasmtime_func_callFunction · 0.85

Calls 2

msgFunction · 0.85
cloneMethod · 0.45

Tested by

no test coverage detected