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

Function wasm_trap_message

crates/c-api/src/trap.rs:131–137  ·  view source on GitHub ↗
(trap: &wasm_trap_t, out: &mut wasm_message_t)

Source from the content-addressed store, hash-verified

129
130#[unsafe(no_mangle)]
131pub extern "C" fn wasm_trap_message(trap: &wasm_trap_t, out: &mut wasm_message_t) {
132 let mut buffer = Vec::new();
133 buffer.extend_from_slice(format!("{:?}", trap.error).as_bytes());
134 buffer.reserve_exact(1);
135 buffer.push(0);
136 out.set_buffer(buffer);
137}
138
139#[unsafe(no_mangle)]
140pub extern "C" fn wasm_trap_origin(raw: &wasm_trap_t) -> Option<Box<wasm_frame_t<'_>>> {

Callers 15

exit_with_errorFunction · 0.85
exit_with_errorFunction · 0.85
exit_with_errorFunction · 0.85
exit_with_errorFunction · 0.85
exit_with_errorFunction · 0.85
exit_with_errorFunction · 0.85
exit_with_errorFunction · 0.85
exit_with_errorFunction · 0.85
exit_with_errorFunction · 0.85
exit_with_errorFunction · 0.85
exit_with_errorFunction · 0.85
exit_with_errorFunction · 0.85

Calls 5

as_bytesMethod · 0.80
set_bufferMethod · 0.80
newFunction · 0.50
reserve_exactMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected