Nice video thank you ! I think it is better in the anonymous lifetime trick to use the new "use" keyword. This is because the trait bound constraints your Future to live at least for '_ but I think you actually want to say that it must live at most for '_. You can have many issues satisfying the borrow checker to accept your callback by not using the correct lifetime constraint like this in the API. So I think your type should be Box>>> If you use an older Rust version you would use the "Capture Trick" instead.
Things are getting much more complicated when you deal with async in Rust. Thanks for your research and explanation.
Glad to help! It's complicated to talk about in a semi-coherent way 😄
Demn, this is so underrated, you deserve more subs 💪
Appreciate that!
Nice video thank you !
I think it is better in the anonymous lifetime trick to use the new "use" keyword. This is because the trait bound constraints your Future to live at least for '_ but I think you actually want to say that it must live at most for '_. You can have many issues satisfying the borrow checker to accept your callback by not using the correct lifetime constraint like this in the API.
So I think your type should be Box>>>
If you use an older Rust version you would use the "Capture Trick" instead.
IIRC, this behaviour will be default without the use keyword in the Rust 2024 Edition
Great video!
Thanks!
*RUclipsErs