Closed dignifiedquire closed 4 years ago
This is not currently possible with rental as it stands now, but there is a workaround. You could try making your suffix field an enum with states for all the possible types it can be, and impl functions for it that can transition it between variants. This way the actual type of the rental struct doesn't change. There will be slight overhead when matching on the enum, but this is probably the best solution.
Thank you, that works for now.
I would like to do the following
I have sth that can transform
Parsed1<'a>
intoParsed2<'a>
, but the problem is that I can not getraw
andparsed
out ofA
at the same time.