How to create a static mutable hashmap?

How to create a static mutable hash? I'm fine with unsafe code.

Normal static does not allow global variables with constructors.

As an example, I want to have https://gist.github.com/Kimundi/8782487 , but the HASHMAP can be changed.

I understand that a global shared mutable state is not that very rusty, but I just want to know if this is possible.

+4
source share
1 answer

After seeing how you already have a solution for a global object that is not modified, perhaps you can use one of the containers cellto add internal volatility

, . . hashmap /, ?

stdin, .

+8

Source: https://habr.com/ru/post/1569755/


All Articles