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

Method get_startup_func

crates/wasmtime/src/runtime/vm/instance.rs:623–634  ·  view source on GitHub ↗

Returns a `Func` corresponding to the startup function for this instance, if generated at compile time. # Safety The `store` parameter must be the store that owns this instance and the functions that this instance can reference.

(
        self: Pin<&mut Self>,
        registry: &ModuleRegistry,
        store: StoreId,
    )

Source from the content-addressed store, hash-verified

621 /// The `store` parameter must be the store that owns this instance and the
622 /// functions that this instance can reference.
623 pub unsafe fn get_startup_func(
624 self: Pin<&mut Self>,
625 registry: &ModuleRegistry,
626 store: StoreId,
627 ) -> Option<crate::Func> {
628 let func_ref = self.get_start_func_ref(registry)?;
629
630 // SAFETY: the validity of `func_ref` is guaranteed by the validity of
631 // `self`, and the contract that `store` must own `func_ref` is a
632 // contract of this function itself.
633 Some(unsafe { crate::Func::from_vm_func_ref(store, func_ref) })
634 }
635
636 /// Lookup a table by index.
637 ///

Callers 1

start_rawMethod · 0.80

Calls 1

get_start_func_refMethod · 0.80

Tested by

no test coverage detected