I'm currently playing around with global variables just for fun. (yes I know that global variables are "evil", but I like to explore weird stuff in languages)
I managed to create a global variable, and I understand how and why it should be mutexed. Here is what I came up with: Rust Playground
I do not really like that the functions I need to access the global variable are not methods of the global variable itself. What I would like is to have something like this:
I tried to write an impl block for Mutex<State> which does not work because it technically counts as an impl for Mutex<T> and that can only be done in the Mutex-crate itself, if I'm not mistaken. Is there any possibility to do what I want, or am I stuck with the standalone functions?