Hi,
I have this bit of code on Rust Playground
It works okay if I remove the second argument in closure i.e. Arc<RwLock<Maelstorm>>
but it breaks with this argument present. I already tried specifying send/sync constraints on the generic parameter but that doesn't fix it so I must be doing some thing wrong.
fn register<F, Fut>(&mut self, name: &str, func: F) where F: Fn(String, Arc<RwLock<Maelstorm>>) -> Fut + Send + Sync + 'static, Fut: Future<Output = Result<(), String>> + Send + Sync + 'static, {}
Can someone help me with this please ?