Reads the `file` specified for the WebAssembly bytes that are going to be compiled. This method will read `file` from the filesystem and interpret it as a WebAssembly binary. A DWARF package file will be probed using the root of `file` and with a `.dwp` extension. If found, it will be loaded and DWARF fusion performed. # Errors This method will return an error if WebAssembly bytes have already
(&mut self, file: &'a Path)
| 167 | /// If DWARF fusion is performed and the DWARF packaged file cannot be read |
| 168 | /// then an error will be returned. |
| 169 | pub fn wasm_binary_file(&mut self, file: &'a Path) -> Result<&mut Self> { |
| 170 | let wasm = std::fs::read(file) |
| 171 | .with_context(|| format!("failed to read input file: {}", file.display()))?; |
| 172 | self.wasm_binary(wasm, Some(file)) |
| 173 | } |
| 174 | |
| 175 | /// Equivalent of [`CodeBuilder::wasm_binary_file`] that also accepts the |
| 176 | /// WebAssembly text format. |
no test coverage detected