Suppose there is a function
fn basket_from_apple(apple: &'a mut Apple) -> Basket<'a>;
which makes a Basket which refers to Apple somewhere inside of it. I can't modify the code for basket_from_apple. It's in a different package.
I want to be able to just give basket_from_apple the Apple, so I don't need to hold on to it, and I want Basket's Drop to destroy the Apple along with the Basket.
Is there some way of doing that in rust? For instance, is there some kind of box-like object, AppleBasket, that I could somehow put the Apple and the Basket into? I want to keep the Apple private, and I want to keep the Basket unmovable, but still accessible by immutable reference.