pub struct TaskGroup { /* private fields */ }Expand description
A set of SpawnedTasks shut down together.
Each task owns its own cancellation token; shutdown cancels all of them,
then drains each within a per-task grace period, aborting stragglers
so a single wedged task cannot stall teardown.
Implementations§
Source§impl TaskGroup
impl TaskGroup
Sourcepub fn push(&mut self, task: SpawnedTask)
pub fn push(&mut self, task: SpawnedTask)
Add a task to the group.
Sourcepub fn cancel_all(&self)
pub fn cancel_all(&self)
Cancel every task without waiting.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TaskGroup
impl RefUnwindSafe for TaskGroup
impl Send for TaskGroup
impl Sync for TaskGroup
impl Unpin for TaskGroup
impl UnsafeUnpin for TaskGroup
impl UnwindSafe for TaskGroup
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more