1 2 3 4 5 6 7 8 9
use std::sync::mpsc::SyncSender; pub(crate) struct NotifyOnExit(pub SyncSender<()>); impl Drop for NotifyOnExit { fn drop(&mut self) { let _ = self.0.try_send(()); } }