Our great sponsors
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
-
rust-embed
Rust Macro which loads files into the rust binary at compile time during release and loads the file from the fs during dev.
-
rust-embed
Rust Macro which loads files into the rust binary at compile time during release and loads the file from the fs during dev. (by Spaceface16518)
The best resource to learn Rust is probably the book. It certainly covers all basics needed and is a good read overall. Most people start with that and go from there.
theme
What is the best way, with wasm-bindgen, to get a reference to a global javascript object? I want to use highlightjs loaded from a CDN. I've come across two ways to do it. The first one works... but it feels like I'm a wizard binding a demon. On the upside, though, it seems nicer in that there's a typed reference to the object itself and the function. This also has the downside of triggering some browser deprecation warnings in the console while iterating all the entries in the globals list.
I recommend you read the "too many lists" article, which goes through why it's hard to build a linked list in Rust without using unsafe: https://rust-unofficial.github.io/too-many-lists/
For reference, there are examples for several frameworks in the rust-embed repo.
Here's an example I wrote up.