Open yaojiu19 opened 1 year ago
What is actually happening ?
I'm a beginner of rust.
I want move of ownership to closure, but Fn
applies to closures that don’t move captured values out of their body and that don’t mutate captured values.
T: Fn(Event) -> Option
I want move of ownership to closure, but Fn applies to closures that don’t move captured values out of their body and that don’t mutate captured values.
That's because you cannot.
You could use a global variable for that (that's unsafe but it works if your program is simple enough).
Or an Arc<Mutex<T>>
when i use grab, i cant modify environment variable;