Skip to main content

read_wasm

Function read_wasm 

Source
pub fn read_wasm(
    target_dir: &Path,
    crate_name: &str,
    profile_target_dir: &str,
    max_bytes: usize,
) -> Result<Vec<u8>, ArtifactError>
Expand description

Read a compiled Wasm artifact for one crate.

The caller supplies the maximum accepted artifact size. Reads and allocation are bounded by the shared host library; symbolic links remain allowed in caller-controlled target directories. This reads bytes without validating the Wasm module; use ic_host_tools::wasm::inspect for structural facts.

ยงErrors

Returns the shared filesystem, non-regular-file, allocation or size-limit error.