How to create a block of static data

3 years ago by SigmarStern to c/rust

I want to create a global hash map that maps strings to vectors of colors. This data needs to be queried by multiple functions and should just be hard coded into the program. That doesn't seem possible.

Now, how is the right (tm) way to do something like that in Rust? What if you need just a bunch of data structures from the beginning of the program until its end where some of the data needs to allocated?

load all comments
PrincipleOfCharity 5 points 3 years ago path: 0 534115, hotness: undefined, score: 5, children: 0
rust
rust

@lemmy.ml

login for more options
9404
398
101

go to feed...