Skip to main content

serialize_module

Function serialize_module 

Source
pub fn serialize_module(module: &ExportedModule) -> Vec<u8> 
Expand description

Serialize an ExportedModule to a compact binary format.

The format is:

  • 4-byte magic number (OXLN)
  • 4-byte format version
  • module name (length-prefixed UTF-8)
  • version string (length-prefixed UTF-8)
  • dependency count + dependency name strings
  • declaration count + serialized Declaration values
  • metadata count + (key, value) string pairs