You cannot declare a static field in a structure.
You can declare a static variable in the module scope as follows:
static FOO: int = 42;
And you cannot change a static variable without unsafe code: in order to follow the borrowing rules, you would have to wrap them in a container in order to perform earnings checks at runtime and be Sync , for example Mutex or RWLock , but they cannot be stored in a static variable, since they have non-trivial constructors.
source share