Function wat::parse_file

source ·
pub fn parse_file(file: impl AsRef<Path>) -> Result<Vec<u8>>
Expand description

Parses a file on disk as a WebAssembly Text format file, or a binary WebAssembly file

This function will read the bytes on disk and delegate them to the parse_bytes function. For more information on the behavior of parsing see parse_bytes.

§Errors

For information about errors, see the parse_bytes documentation.

§Examples

let binary = wat::parse_file("./foo.wat")?;
// ...