1 unstable release
new 0.1.0 | Dec 18, 2024 |
---|
#295 in WebAssembly
Used in rudelctl
41KB
923 lines
Rudelblinken Runtime
Host runtime for rudelblinken wasm modules. This crate provides functionality to link your host implementation with a rudelblinken wasm module.
For testing this provides a simulated host implementation in rudelblinken_runtime::emulated_host::EmulatedHost
You can use it like this:
use rudelblinken_runtime::emulated_host::EmulatedHost;
use rudelblinken_runtime::linker::setup;
const WASM_MOD: &[u8] = include_bytes!(
"../../rudelblinken-wasm/target/wasm32-unknown-unknown/release/rudelblinken_wasm.wasm"
);
let host = EmulatedHost::new();
let mut instance = setup(WASM_MOD, host).unwrap();
instance.run().unwrap();
lib.rs
:
Rudelblinken Runtime
Host runtime for rudelblinken wasm modules. This crate provides functionality to link your host implementation with a rudelblinken wasm module.
For testing this provides a simulated host implementation in rudelblinken_runtime::emulated_host::EmulatedHost
You can use it like this:
use rudelblinken_runtime::emulated_host::EmulatedHost;
use rudelblinken_runtime::linker::setup;
const WASM_MOD: &[u8] = include_bytes!(
"../../rudelblinken-wasm/target/wasm32-unknown-unknown/release/rudelblinken_wasm.wasm"
);
let host = EmulatedHost::new();
let mut instance = setup(WASM_MOD, host).unwrap();
instance.run().unwrap();
Dependencies
~4.5MB
~101K SLoC