Crates.io | wasi-common-lucet |
lib.rs | wasi-common-lucet |
version | 0.4.2 |
source | src |
created_at | 2019-09-04 13:53:40.474717 |
updated_at | 2020-02-06 14:15:07.576733 |
description | wasi-common wrappers for Lucet |
homepage | https://github.com/jedisct1/wasi-common-lucet |
repository | https://github.com/jedisct1/wasi-common-lucet |
max_upload_size | |
id | 162122 |
size | 22,341 |
A crate to use the reference WASI implementation in WebAssembly modules run with Lucet.
wasi_common_lucet::export_wasi_funcs()
once in order to have the symbols exportedWasiCtx::new()
. Note that the function signature slightly differs from the lucet-wasi
one.insert_embed_ctx()
.use wasi_common_lucet::WasiCtx;
fn doit() -> Result <(), Error> {
wasi_common_lucet::export_wasi_funcs();
// ...
let mut lucet_instance_handle = lucet_dylib.instantiate(region)?;
let wasi_ctx: WasiCtx = WasiCtx::new(["app"].iter())?;
lucet_instance_handle.insert_embed_ctx(wasi_ctx);
// ...
}