pub trait Dispose {
// Required method
fn dispose(self);
}Expand description
A trait representing a standard “dispose” method for consuming an object at the end of its scope.
The typical use case of this trait is for encapsulating objects in
Disposable wrappers, which will automatically call dispose on drop,
but it is perfectly acceptable to call dispose by itself.
See this page for example usage.