pub fn parse_str(wat: impl AsRef<str>) -> Result<Vec<u8>, Error>Expand description
Parses an in-memory string as the text format, returning the file as a binary WebAssembly file.
This function is intended to be a stable convenience function for parsing a
*.wat file into a WebAssembly binary. This is a high-level operation which
does not expose any parsing internals, for that you’ll want to use the
Module type and the wast crate.
§Errors
This function can fail for a number of reasons, including (but not limited to):
- The
watinput may fail to lex, such as having invalid tokens or syntax - The
watinput may fail to parse, such as having incorrect syntactical structure - The
watinput may contain names that could not be resolved