There’s nothing built-in that would do this but this should help (you will need to call initialize()
in the beginning of every test):
use std::sync::Once;
static INIT: Once = Once::new();
pub fn initialize() {
INIT.call_once(|| {
// initialization code here
});
}