pub unsafe trait PinnedDrop {
    unsafe fn drop(self: Pin<&mut Self>);
}
Expand description

Trait facilitating pinned destruction.

Use pinned_drop to implement this trait safely:

use core::pin::Pin;
use pinned_init::*;
#[pin_project(PinnedDrop)]
struct Foo {
    #[pin]
    mtx: Mutex<usize>,
}

#[pinned_drop]
impl PinnedDrop for Foo {
    fn drop(self: Pin<&mut Self>) {
        println!("Foo is being dropped!");
    }
}

Safety

This trait must be implemented with pinned_drop.

Required Methods

Executes the pinned destructor of this type.

Safety

Only call this from <Self as Drop>::drop.

Implementors