I want to mutate some data in the pad.
I see an example of working with pads here https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/blob/0.18.8/examples/src/bin/pad_probes.rs#L40
It seems like I can only use callbacks that don't modify anything they capture since the callback type is func: F
. I tried to simply use one of my variables inside the closure and got this:
error[E0594]: cannot assign to `self.frame_id`, as `Fn` closures cannot mutate their captured variables
--> src/decoding_branch.rs:161:13
|
161 | self.frame_id += 1;
| ^^^^^^^^^^^^^^^^^^ cannot assign
How I'm supposed to change anything in pads?