Hi, I got the error cannot borrow X as mutable more than once at a time using this playground code which utilizes traits, lifetimes and mutability. I tried everything, but can't find a solution.
It looks like I need to think over the concept of my program again, but maybe there is an actual solution to this issue.
The problem is that you are using the same lifetime everywhere, thus requiring all of them to be the same. In practice however you don't always want lifetimes to be the same, actually most of the time you want to allow them to be different, otherwise one would be overconstrained due to appearing in another type.
It's unclear from your "simplified" example how the trait will be used, so it's hard to tell which lifetimes actually need to be equal and which can be different. I would suggest starting with all lifetimes being different and only later make them equal if you notice that they need to be.