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

Method to_raw

crates/wasmtime/src/runtime/func.rs:1075–1077  ·  view source on GitHub ↗

Extracts the raw value of this `Func`, which is owned by `store`. This function returns a value that's suitable for writing into the `funcref` field of the [`ValRaw`] structure. # Safety The returned value is only valid for as long as the store is alive. This value is safe to pass to [`Func::from_raw`] so long as the same `store` is provided.

(&self, mut store: impl AsContextMut)

Source from the content-addressed store, hash-verified

1073 /// This value is safe to pass to [`Func::from_raw`] so long as the same
1074 /// `store` is provided.
1075 pub fn to_raw(&self, mut store: impl AsContextMut) -> *mut c_void {
1076 self.to_raw_(store.as_context_mut().0)
1077 }
1078
1079 pub(crate) fn to_raw_(&self, store: &mut StoreOpaque) -> *mut c_void {
1080 self.vm_func_ref(store).as_ptr().cast()

Callers 9

bench_host_to_wasmFunction · 0.45
bench_callsFunction · 0.45
call_wrapped_funcFunction · 0.45
anyref_to_raw_structFunction · 0.45
i31ref_to_raw_round_tripFunction · 0.45
call_impl_do_callMethod · 0.45
store_untyped_resultsMethod · 0.45
wasmtime_func_to_rawFunction · 0.45

Calls 2

to_raw_Method · 0.45
as_context_mutMethod · 0.45

Tested by 4

call_wrapped_funcFunction · 0.36
anyref_to_raw_structFunction · 0.36
i31ref_to_raw_round_tripFunction · 0.36