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

Function wasmtime_caller_export_get

crates/c-api/src/func.rs:444–460  ·  view source on GitHub ↗
(
    caller: &mut wasmtime_caller_t,
    name: *const u8,
    name_len: usize,
    item: &mut MaybeUninit<wasmtime_extern_t>,
)

Source from the content-addressed store, hash-verified

442
443#[unsafe(no_mangle)]
444pub unsafe extern "C" fn wasmtime_caller_export_get(
445 caller: &mut wasmtime_caller_t,
446 name: *const u8,
447 name_len: usize,
448 item: &mut MaybeUninit<wasmtime_extern_t>,
449) -> bool {
450 let name = match str::from_utf8(crate::slice_from_raw_parts(name, name_len)) {
451 Ok(name) => name,
452 Err(_) => return false,
453 };
454 let which = match caller.caller.get_export(name) {
455 Some(item) => item,
456 None => return false,
457 };
458 crate::initialize(item, which.into());
459 true
460}
461
462#[unsafe(no_mangle)]
463pub unsafe extern "C" fn wasmtime_func_from_raw(

Callers 1

get_exportMethod · 0.85

Calls 3

slice_from_raw_partsFunction · 0.85
initializeFunction · 0.70
get_exportMethod · 0.45

Tested by

no test coverage detected