pub fn register_object_destructor<'a, D: ObjectDestructor>(
destructor: D,
) -> ObjectDestructorHandle<'a, D>Expand description
Registers a destructor which will be called when certain core objects are about to be destroyed.
Returns a handle to the registered destructor. The destructor will be unregistered when the handle is dropped.
To keep the destructor alive forever, move the ObjectDestructorHandle into std::mem::ManuallyDrop.