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

Function wasmtime_exnref_field

crates/c-api/src/exnref.rs:71–82  ·  view source on GitHub ↗
(
    mut store: WasmtimeStoreContextMut<'_>,
    exn: &wasmtime_exnref_t,
    index: usize,
    val_ret: &mut MaybeUninit<wasmtime_val_t>,
)

Source from the content-addressed store, hash-verified

69
70#[unsafe(no_mangle)]
71pub unsafe extern "C" fn wasmtime_exnref_field(
72 mut store: WasmtimeStoreContextMut<'_>,
73 exn: &wasmtime_exnref_t,
74 index: usize,
75 val_ret: &mut MaybeUninit<wasmtime_val_t>,
76) -> Option<Box<wasmtime_error_t>> {
77 let mut scope = RootScope::new(&mut store);
78 let rooted = exn.as_wasmtime()?.to_rooted(&mut scope);
79 handle_result(rooted.field(&mut scope, index), |val| {
80 crate::initialize(val_ret, wasmtime_val_t::from_val(&mut scope, val));
81 })
82}
83
84#[unsafe(no_mangle)]
85pub unsafe extern "C" fn wasmtime_context_set_exception(

Callers 1

fieldMethod · 0.85

Calls 6

handle_resultFunction · 0.85
as_wasmtimeMethod · 0.80
initializeFunction · 0.70
newFunction · 0.50
to_rootedMethod · 0.45
fieldMethod · 0.45

Tested by

no test coverage detected