D
Deno

help

rusty_v8 - how to pass data from js/v8 into rust

WWereii1/15/2024
Hello, I am playing with rusty_v8, by following the examples I was able to get js eval up and running quite nicely. Now, I am trying out Function/FunctionTemplate stuff and I tried to do this (simplified and wrong):
let mut buffer = String::new();

FunctionTemplate::new(&mut handle_scope, |scope, args, _retval|{
// extract args
buffer.push(some_data);
})
let mut buffer = String::new();

FunctionTemplate::new(&mut handle_scope, |scope, args, _retval|{
// extract args
buffer.push(some_data);
})
This won't compile because only Fn type is accepted, not FnMut (which makes sense). Am I missing something trivial or is there some other way to do this? I tried set_slot/get_slot but I don't think I am using it right (or even for the right purpose?) as I am getting assertion errors from the internal hashmap. Thanks a lot for any pointers!
Ffoobar1/15/2024
Stack Overflow
WASM & Deno / Extract and manipulate Array of Date
I try to extract and manipulate an array of date in a function in WASM project for Deno The rust function doesn't compile. How to manipulate Date and convert it ? Does someone have a repository/lin...
Ffoobar1/15/2024
not function but maybe can help
WWereii1/15/2024
thanks @foobar but that does not seem to be even remotely touching rusty_v8/v8 apis

Looking for more? Join the community!