feat: add __network/html-crawl-parse, __wasm/wasmtime-serde-demo

This commit is contained in:
2024-03-24 13:15:59 +08:00
parent 8adc5a58bc
commit f5a41fdb02
30 changed files with 3574 additions and 1 deletions

View File

@@ -0,0 +1,20 @@
use serde::{Deserialize, Serialize};
use wasmtime_serde_guest::*;
#[derive(Debug, Deserialize, Serialize)]
struct Human {
name: String,
age: u8,
}
#[export_fn]
fn add(a: i32, b: i32) -> i32 {
let human = get_human();
println(format!("{human:?}"));
a + b
}
import_fn!(
fn get_human() -> Human;
fn println(msg: String);
);