This question is a bit weird. If it's not clear what I'm asking, please point out the confusion (so I can improve the question) rather than guessing the question.
Here is the problem:
-
I have "pub struct MeshData { ... }"
-
I have 2000+ objects of type "MeshData" -- they have names apple_red, apple_green, apple_rotten, ..., orange_big, orange_tangerine, orange_mandarin, ..., chair_wooden, chair_plastic, chair_aeron, ..., car_truck, car_tesla, car_f1, ..
-
This list of objects is static, determined at COMPILE TIME, and does NOT CHANGE during runtime.
-
I want to hard code this list of items into a *.rs file -- so that rustc can, statically, at compile time, notify me any missing object.
=====
Here are the solutions I have considered:
sol1_dont_do_this:
This "solution" is not acceptable as I really want compile time checking / warning of any non-existent object.
sol2_use_const
Here ,we can either have a single module, mesh::car_..., mesh::orange_... ,
or submodules mesh::: ... mesh::orange::..., ...
This is the best solution I have so far.
What I don't like about this is that IntelliJ wants me to name consts using all caps, i.e.
mesh::TRUCK , mesh:
:TESLA, ...
=====
Any other suggestions?