Hi everyone, i am working on tokio application where i need to pass a struct in to the stream fold , that struct contains a closures and/or pointers to the functions (depends). I have tried many different approaches and could not pass compiler errors like live times and so on.
I have created Gist code example of how i would like it to work (it is just and example and i would really like to get rid of Boxes and make it look nicer). Unfortunately it does not work any way (with or without Boxes)
I would really appreciate if someone helps me with this issue and explains why i it should be that way as i have spend last 3 days trying to resolve and could not do that. Thank you very much
Also i had topic on reddit related this issue: