is there any , even unsafe, way to get a global couple of (Sender, Receiver) ?
I tried something like this:
static mut RESULT_SENDER: Option<Sender<(r::BlockedClient, Result<r::QueryResult, err::RediSQLError>)>> = None; static mut RESULT_RECEIVER: Option<Receiver<(r::BlockedClient, Result<r::QueryResult, err::RediSQLError>)>> = None;
But when I try to move them out I get an error:
error[E0507]: cannot move out of static item │ --> src/lib.rs:472:72 │ | │472 | r::listen_and_execute(rc, rx, &RESULT_SENDER.unwrap().clone()); │ | ^^^^^^^^^^^^^ cannot move out of static item
I also tried lazy_static but I ended up opening an issues: https://github.com/rust-lang-nursery/lazy-static.rs/issues/93
Even though I believe that the problem is more complex than a mere syntax one.
Do you have any thoughts?