MCPcopy Index your code
hub / github.com/explodingcamera/tinywasm / parse_module_file

Method parse_module_file

crates/parser/src/lib.rs:216–220  ·  view source on GitHub ↗

Parse a [`Module`] from a file. Requires `std` feature.

(&self, path: impl AsRef<crate::std::path::Path> + Clone)

Source from the content-addressed store, hash-verified

214 #[cfg(feature = "std")]
215 /// Parse a [`Module`] from a file. Requires `std` feature.
216 pub fn parse_module_file(&self, path: impl AsRef<crate::std::path::Path> + Clone) -> Result<Module> {
217 let file = crate::std::fs::File::open(&path)
218 .map_err(|e| ParseError::Other(alloc::format!("Error opening file {:?}: {}", path.as_ref(), e)))?;
219 self.parse_module_stream(&mut crate::std::io::BufReader::new(file))
220 }
221
222 #[cfg(feature = "std")]
223 /// Parse a [`Module`] from a stream. Requires `std` feature.

Callers 1

parse_fileFunction · 0.80

Calls 1

parse_module_streamMethod · 0.80

Tested by

no test coverage detected