Hello,
I've noticed that for a large majority of the projects I've coded in Rust, I've needed to use shared globals statics data. And the only way to do this safely is to use Crate lazy_static .
Ex:
lazy_static! {
static ref TOKIO_RUNTIME: tokio::runtime::Runtime = tokio::runtime::Builder::new_multi_thread()
.enable_all()
.build()
.expect("TOKIO RUNTIME ERROR");
static ref ACTIONS_QUEUE: Arc<Mutex<VecDeque<WaitingAction>>> = Arc::new(Mutex::new(VecDeque::new()));
}
Wouldn't it be easier to do this natively in Rust without having to use a Crate (and therefore a compile-time cost to interpret the Macros)?