I'm not sure it matches your use case, but to me it sounds line you want to serialize data!
I'd take a look at the ron
and serde
crates. I'm doing something similar with Dialogue data in my game, where I load all data into a hashmap, using an integer value as a key for the time being. I then stuff the hashmap in a resource. Links below for code reference!
It might not be the most scaleable or elegant way to handle it, but it does the trick for me. :)