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

Method serialize

crates/wasmtime/src/runtime/component/component.rs:603–609  ·  view source on GitHub ↗

Same as [`Module::serialize`], except for a component. Note that the artifact produced here must be passed to [`Component::deserialize`] and is not compatible for use with [`Module`]. [`Module::serialize`]: crate::Module::serialize [`Module`]: crate::Module

(&self)

Source from the content-addressed store, hash-verified

601 /// [`Module::serialize`]: crate::Module::serialize
602 /// [`Module`]: crate::Module
603 pub fn serialize(&self) -> Result<Vec<u8>> {
604 let image = self.engine_code().image();
605 let mut v = TryVec::new();
606 v.reserve(image.len())?;
607 v.try_extend(image.iter().copied())?;
608 Ok(v.into())
609 }
610
611 /// Creates a new `VMFuncRef` with all fields filled out for the destructor
612 /// specified.

Callers

nothing calls this directly

Calls 9

OkFunction · 0.85
copiedMethod · 0.80
newFunction · 0.50
imageMethod · 0.45
engine_codeMethod · 0.45
reserveMethod · 0.45
lenMethod · 0.45
try_extendMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected