Files
hemma/backend/src/util.rs
2023-12-03 17:52:38 +01:00

16 lines
289 B
Rust

use tokio::task::AbortHandle;
pub struct DeadMansHandle(pub AbortHandle);
impl From<AbortHandle> for DeadMansHandle {
fn from(abort: AbortHandle) -> Self {
DeadMansHandle(abort)
}
}
impl Drop for DeadMansHandle {
fn drop(&mut self) {
self.0.abort();
}
}