#[pinned_drop]
Expand description
Used to implement PinnedDrop
safely.
Only works on structs that are annotated via #[
pin_data
]
.
§Examples
#[pin_data(PinnedDrop)]
struct DriverData {
#[pin]
queue: Mutex<KVec<Command>>,
buf: KBox<[u8; 1024 * 1024]>,
raw_info: *mut bindings::Info,
}
#[pinned_drop]
impl PinnedDrop for DriverData {
fn drop(self: Pin<&mut Self>) {
unsafe { bindings::destroy_info(self.raw_info) };
}
}