WASM / Extract and manipulate Array of Date
I try to extract and manipulate an array of date in a function
The rust fn doesn't compile. How to manipulate Date and convert it ?
Does someone have a repository/link with example of Rust + Deno library ?
Cargo.toml
mod.ts
lib.rs
2 Replies
The documentation does not provide a clear example of how to manipulate an array of dates in Rust and convert it for use in Deno. However, it does mention that for more complex types like classes or strings, you would want to use tools that generate type bindings between JavaScript and the language used to compile to WebAssembly.
In your case, you are using Rust and you might want to look into using the
wasm-bindgen
tool which is designed to generate these type bindings. The wasm-bindgen
tool can help you to work with complex types and JavaScript APIs in your Rust code.
The documentation also mentions the js_sys
crate which provides bindings to JavaScript's standard, built-in objects. This might be useful for working with JavaScript Date objects in your Rust code.
However, the exact code to manipulate an array of dates in Rust and convert it for use in Deno is not provided in the documentation. You might want to look for more specific examples or tutorials online that deal with this particular use case.
Remember to always test your code thoroughly to ensure it works as expected. 🦕Solution on stackoverflow