3 ms·
async drop is exciting because it means you can use the RAII[1] pattern for arbitrary resources. I've used this to, for example, manage infrastructure spun up f
by paulgb 4y ago
async drop is exciting because it means you can use the RAII[1] pattern for arbitrary resources. I've used this to, for example, manage infrastructure spun up for integration tests. I spin up a Docker container at some point in the test, assign the result to a guard variable, and then use RAII to clean it up when the variable goes out of scope.
Making it work without async drop was pretty hacky, so I'm looking forward to removing those hacks. Well done, Rust team!
[1] https://en.wikipedia.org/wiki/Resource_acquisition_is_initialization https://en.wikipedia.org/wiki/Resource_acquisition_is_initia...