MCPcopy Index your code
hub / github.com/explodingcamera/tinywasm / serialize_twasm

Method serialize_twasm

crates/types/src/archive.rs:58–61  ·  view source on GitHub ↗

Serializes the [`Module`] into a vector of bytes.

(&self)

Source from the content-addressed store, hash-verified

56
57 /// Serializes the [`Module`] into a vector of bytes.
58 pub fn serialize_twasm(&self) -> Result<Vec<u8>, TwasmError> {
59 let buf = Vec::from(TWASM_MAGIC);
60 postcard::to_extend(self, buf).map_err(TwasmError::InvalidArchive)
61 }
62}
63
64#[cfg(test)]

Callers 8

mainFunction · 0.80
runFunction · 0.80
test_invalid_magicFunction · 0.80
test_invalid_versionFunction · 0.80
runFunction · 0.80
tinywasm_to_twasmFunction · 0.80
fibonacci_to_twasmFunction · 0.80
argon2id_to_twasmFunction · 0.80

Calls

no outgoing calls

Tested by 2

test_invalid_magicFunction · 0.64
test_invalid_versionFunction · 0.64