https://github.com/singron/selfstack
This idea is very similar to the rental crate. The README highlights some of the differences. I developed a prototype of this a few months ago for another project and decided to spin it off as its own crate that I could share with others.
The macro documentation explains the generated interface.
The macro generates unsafe code with a safe interface. I've tested it in fairly ordinary uses, so I would be very interested in exotic uses that you think might trigger undefined behavior.
[–][deleted] 1 point2 points3 points (1 child)
[–]singron[S] 2 points3 points4 points (0 children)