Relevant function: HtmlImageElement in web_sys - Rust
This function takes as an argument an object of type Function
, namely Function in js_sys - Rust
Problem is that both constructors look like they take &str
representing JS code for the callback.
I have an existing Rust function I would like to use as the callback. Is there anyway to transform it into a Function
?
s3bk
2
1 Like
Thanks, there is also rustwasm/gloo : https://github.com/rustwasm/gloo/blob/master/crates/events/src/lib.rs which appears to do the same thing but provides slightly nicer wrapper functions.
system
Closed
4
This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.