You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I was hoping I could get some help on this.
I'm trying to pass an array of bytes into a host function and I can't seem to find a solution.
I looked into using a WasmPtr but I can't get a MemoryView into the function.
Here is my code.
`
use wasmer::{Store, Module, imports, Instance, Function, FunctionEnvMut, FunctionEnv, WasmPtr, Memory, MemoryView, TypedFunction};
fn alert(_: FunctionEnvMut, m: &MemoryView, s: WasmPtr, len: u32){
match s.read_utf8_string(m, len) {
Ok(s) => println!("{s}"),
Err(e) => println!("Error: {e}")
}
}
#[derive(Clone)]
struct MyEnv{
}
fn wasm_test() -> Result<(), Box>{
let mut store = Store::default();
}
`
If someone could help me out, that would be great.
Thanks
Beta Was this translation helpful? Give feedback.
All reactions