pub enum Finalizer {
Native(unsafe fn(*mut ())),
Runtime(Arc<dyn Destructor>),
}Expand description
How an owning box drops the value it holds.
A Rust type gives a function pointer. A runtime type needs its field list,
so it keeps a Destructor alive for as long as a value of that type
exists.
An unsafe fn(*mut ()) converts into Finalizer::Native.
Variants§
Native(unsafe fn(*mut ()))
A Rust type’s own destructor.
Runtime(Arc<dyn Destructor>)
A runtime type’s field walker, kept alive by the value that needs it.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Finalizer
impl !UnwindSafe for Finalizer
impl Freeze for Finalizer
impl Send for Finalizer
impl Sync for Finalizer
impl Unpin for Finalizer
impl UnsafeUnpin for Finalizer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more