I'm facing an issue with the design of a piece of code.
Basically I would like to have a function on an object that takes something that looks like a context so that the function can then call functions of other objects inside the context.
I believe this could be a poor design and of course it's not working.
Here's an example: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=571d12e6a2ef1be8e2c8c87d4dd51b13
What would it be the idiomatic way to achieve something like that?