Function wasmer_cli::commands::create_exe::volume_file_block

source ·
fn volume_file_block(volumes: &BTreeMap<String, Volume>) -> Vec<u8> 
Expand description

Serialize a set of volumes so they can be read by the C API.

This is really backwards, but the only way to create a v1 volume “fileblock” is by first reading every file in a [webc::compat::Volume], serializing it to webc v1’s binary form, parsing those bytes into a [webc::v1::Volume], then constructing a dummy [webc::v1::WebC] object just so we can make a copy of its file block.