How to save global state in rust?

For example, i have some regex that is compiled for better performance, everytime i call a given func i want to use the compiled regex and not compile every time i call a func.

There is any way to do this with rust!?

nevermind... `const` and `static`

You may want to take a look at lazy_static for non-const values.

2 Likes