..

Open Graph Preview w/ Rust

  • immediately went for a struct and then realized i didn’t have a .keys() method like I would in js
  • googling around I saw I should explore building vector of strings at runtime with something like serde, didn’t feel very rust-y
  • read up on macros and was able to get my my vector of strings, felt great to use a rust feature
  • immediately tried to loop over this vector to define field values in my struct but was hit with “cannot index into a value of type OpenGraphData”
  • I ordered some pizza
  • in some stackoverflow i read “dynamic data requires dynamic structures” + found this sweet post on Writing a Hashmap-to-Struct Procedural Macro in Rust

I still have a very iffy understanding on the borrow checked, kinda just fought my way through the compiler until it worked macros are siiick