Given a struct, how can a function be written so that it is automatically called at end of scope, consuming self
rather than using &mut self
(unlike Drop::drop
)?
I would like to call other functions within that destructor that will consume each field of the struct, and I would like the destructor to be called automatically.