INNER CODE UNIT · Rust
drop
pamburus/hl · crates/lifecycle/src/lib.rs:37
fn drop(&mut self) {
self.inner.take(); // drops the inner value
if let Some(f) = self.notify.take() {
f();
}
}
}
// ---
/// Drops a value in a background thread, joining on its own drop.
///
/// This is useful when dropping a value may block (e.g. `Child::wait()`),
/// and you want the drop to happen asynchronously while still ensuring
/// it completes before the owning scope exits.
pub struct AsyncDrop {
handle: Option<JoinHandle<()>>,
}