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

Method load_code

crates/wasmtime/src/engine.rs:936–948  ·  view source on GitHub ↗
(
        &self,
        mmap: crate::runtime::vm::MmapVec,
        expected: ObjectKind,
    )

Source from the content-addressed store, hash-verified

934 }
935
936 pub(crate) fn load_code(
937 &self,
938 mmap: crate::runtime::vm::MmapVec,
939 expected: ObjectKind,
940 ) -> Result<Arc<crate::CodeMemory>> {
941 self.check_compatible_with_native_host()
942 .context("compilation settings are not compatible with the native host")?;
943
944 serialization::check_compatible(self, &mmap, expected)?;
945 let mut code = crate::CodeMemory::new(self, mmap)?;
946 code.publish()?;
947 Ok(try_new(code)?)
948 }
949
950 /// Unload process-related trap/signal handlers and destroy this engine.
951 ///

Callers 4

load_code_bytesMethod · 0.80
load_code_rawMethod · 0.80
load_code_fileMethod · 0.80
from_trusted_fileMethod · 0.80

Calls 7

check_compatibleFunction · 0.85
OkFunction · 0.85
publishMethod · 0.80
newFunction · 0.50
try_newFunction · 0.50
contextMethod · 0.45

Tested by

no test coverage detected