Open vadixidav opened 5 years ago
Making <F: FnMut>
would be enough.
@Pzixel That is true, but we then have to turn it into a dyn FnMut so that we can pass it to C as a single pointer type since the type is erased. We will find out if we can use FnMut based on if any data races can occur in the code. I think there is a good chance we can accept FnMut. We can only do that if the C code never creates a data race. If it does then we will need to use Fn. If C makes a cross thread data race then we will also need to force it to be Send and Sync.
I actually already fixed this in #117. Once that is merged we can close this.
In
highgui_set_mouse_callback
currently it is not possible to pass it a closure. By storing an arbitrarydyn Fn
type in theBox
inside its definition, it should be possible to accept an arbitrary closure to ease callback handling.