Is is possible or advisable to limit the amount of times a particular struct can be instantiated?
To be clear, I'm not talking about global mutable singletons here. I just want to be able to guarantee a struct is only instantiated once.
The struct in question is a wrapper around an application data file. Multiple threads should be able to write to the file, but only through a
Mutex held by the wrapper. If multiple instances of the wrapper exist, then the mutex is worthless.
Can a struct be instantiated once?