1 个不稳定版本
| 0.1.0 | 2021年1月23日 | 
|---|
#74 在 #auto
6KB
66 行
auto-wasi
自动检测wasmtime模块使用的WASI版本并链接。
lib.rs:
封装了wasmtime-wasi,自动检测模块使用的WASI版本。
示例
let wat = r#"
(module
    (type $empty (func))
    ;; In the real world this would be an actual wasi import,
    ;; but this crate only checks the module name.
    (import "wasi_snapshot_preview1" "" (func (type $empty)))
 )
"#;
let store = Store::default();
let ctx = WasiCtx::new(std::env::args())?;
let wasm = wat::parse_str(wat)?;
let wasi = AutoWasi::detect(&store, ctx, wasm)?;
依赖项
~23–32MB
~523K SLoC