pub struct TaskHandles { /* private fields */ }Expand description
异步任务句柄集合(不施加 spawn/join 策略,只管存取与清理)
Implementations§
Source§impl TaskHandles
impl TaskHandles
Sourcepub fn push(&self, handle: JoinHandle<()>)
pub fn push(&self, handle: JoinHandle<()>)
存入句柄;顺带移除已完成的句柄(内存有界)
Sourcepub fn abort_all_retained(&self)
pub fn abort_all_retained(&self)
原地 abort 全部句柄但不移除记录——调用方稍后可用
Self::all_finished 等待其真正终止
Sourcepub fn take_all(&self) -> Vec<JoinHandle<()>>
pub fn take_all(&self) -> Vec<JoinHandle<()>>
取出全部句柄(此后集合为空)
Sourcepub fn all_finished(&self) -> bool
pub fn all_finished(&self) -> bool
全部已记录任务是否都已结束
Trait Implementations§
Source§impl Debug for TaskHandles
impl Debug for TaskHandles
Auto Trait Implementations§
impl !Freeze for TaskHandles
impl Forget for TaskHandles
impl Move for TaskHandles
impl RefUnwindSafe for TaskHandles
impl Send for TaskHandles
impl Sync for TaskHandles
impl Unpin for TaskHandles
impl UnsafeUnpin for TaskHandles
impl UnwindSafe for TaskHandles
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