Returns a hint, if possible, of what the provided bytes are. This method can be use to detect what the previously supplied bytes to methods such as [`CodeBuilder::wasm_binary_or_text`] are. This will return whether a module or a component was found in the provided bytes. This method will return `None` if wasm bytes have not been configured or if the provided bytes don't look like either a compon
(&self)
| 732 | /// or if the provided bytes don't look like either a component or a |
| 733 | /// module. |
| 734 | pub fn hint(&self) -> Option<CodeHint> { |
| 735 | let wasm = self.wasm.as_ref()?; |
| 736 | if wasmparser::Parser::is_component(wasm) { |
| 737 | Some(CodeHint::Component) |
| 738 | } else if wasmparser::Parser::is_core_wasm(wasm) { |
| 739 | Some(CodeHint::Module) |
| 740 | } else { |
| 741 | None |
| 742 | } |
| 743 | } |
| 744 | |
| 745 | /// Finishes this compilation and produces a serialized list of bytes. |
| 746 | /// |
no test coverage detected