Initial reorg.
This is largely the same as #305, but updated for the current tree.
This commit is contained in:
13
crates/misc/rust/examples/markdown.rs
Normal file
13
crates/misc/rust/examples/markdown.rs
Normal file
@@ -0,0 +1,13 @@
|
||||
use wasmtime_rust::wasmtime;
|
||||
|
||||
#[wasmtime]
|
||||
trait WasmMarkdown {
|
||||
fn render(&mut self, input: &str) -> String;
|
||||
}
|
||||
|
||||
fn main() -> anyhow::Result<()> {
|
||||
let mut markdown = WasmMarkdown::load_file("markdown.wasm")?;
|
||||
println!("{}", markdown.render("# Hello, Rust!"));
|
||||
|
||||
Ok(())
|
||||
}
|
||||
Reference in New Issue
Block a user