Question from the Rust test

What C++ feature does the Drop trait resemble in Rust?