How to get an object from a closure, that's confusion with me, here is the question:question: How do i get original person object without changing the source code.
I was playing around with Rust closures when I hit this interesting scenario:This gives an error:Even though the compiler is trying to explain it line by line, I still haven't understood what exactly it is complaining about.
I have a Main method like this:Since I am accessing a local variable b here the compiler creates a class to capture that variable and b becomes the field of that class. Then the b lives as long as the life time of the compiler generated class and it causes...
I want to expand the class Foo by the class Bar, the issue that I have is that I can't expand it in the usual way (class Foo(Bar)) because the class Bar is somewhat dynamically generated.