This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use std::str; | |
| use wasmer_runtime::{ | |
| imports, | |
| func, | |
| instantiate, | |
| error, | |
| Ctx, | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Define a function that is imported into the module. | |
| // By default, the "env" namespace is used. | |
| extern "C" { | |
| fn print_str(ptr: *const u8, len: usize); | |
| } | |
| // Define a string that is accessible within the wasm | |
| // linear memory. | |
| static HELLO: &'static str = "Hello, World!"; |