Party mode
This commit is contained in:
15
backend/src/util.rs
Normal file
15
backend/src/util.rs
Normal file
@ -0,0 +1,15 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user