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

Function wasmtime_instance_export_nth

crates/c-api/src/instance.rs:138–155  ·  view source on GitHub ↗
(
    store: WasmtimeStoreContextMut<'_>,
    instance: &Instance,
    index: usize,
    name_ptr: &mut *const u8,
    name_len: &mut usize,
    item: &mut MaybeUninit<wasmtime_extern_t>,
)

Source from the content-addressed store, hash-verified

136
137#[unsafe(no_mangle)]
138pub unsafe extern "C" fn wasmtime_instance_export_nth(
139 store: WasmtimeStoreContextMut<'_>,
140 instance: &Instance,
141 index: usize,
142 name_ptr: &mut *const u8,
143 name_len: &mut usize,
144 item: &mut MaybeUninit<wasmtime_extern_t>,
145) -> bool {
146 match instance.exports(store).nth(index) {
147 Some(e) => {
148 *name_ptr = e.name().as_ptr();
149 *name_len = e.name().len();
150 crate::initialize(item, e.into_extern().into());
151 true
152 }
153 None => false,
154 }
155}
156
157#[repr(transparent)]
158pub struct wasmtime_instance_pre_t {

Callers 1

getMethod · 0.85

Calls 6

into_externMethod · 0.80
initializeFunction · 0.70
exportsMethod · 0.45
as_ptrMethod · 0.45
nameMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected