forest-filecoin 0.33.6

Rust Filecoin implementation.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// Copyright 2019-2026 ChainSafe Systems
// SPDX-License-Identifier: Apache-2.0, MIT

use tokio::task::AbortHandle;

/// Holds a collection of [`AbortHandle`] and aborts them automatically on drop
#[derive(Default, derive_more::Deref, derive_more::DerefMut)]
pub struct AbortHandles(Vec<AbortHandle>);

impl Drop for AbortHandles {
    fn drop(&mut self) {
        for handle in self.iter() {
            handle.abort();
        }
    }
}