pub struct WaitAll<T> { /* private fields */ }Expand description
等待全部有效交值方分别结束,按登记顺序返回逐项结果。
输出为 Vec<RawResult<T, WaitError>>。最初交值方占第一项,每次有效克隆(Clone)
增加一项;并发克隆按登记成功先后排序,不按交值到达顺序排序。
某份句柄(handle)无值释放,只在自身位置产生 WaitError::SenderDropped。
放弃等待停止新接收与登记,并处理自己已取得的结果;不等待尚在交值的其它线程。
尚存句柄可释放,后续交值返原值和关闭错误。只允许一个轮询(poll)者;
完成后再次轮询恐慌(panic)。不要求 T: Unpin、Sync 或 'static;
跨线程移动要求 T: Send。通知回调异常后不保证继续轮询,仍可放弃等待。
Trait Implementations§
Auto Trait Implementations§
impl<T> !RefUnwindSafe for WaitAll<T>
impl<T> !UnwindSafe for WaitAll<T>
impl<T> Forget for WaitAll<T>
impl<T> Freeze for WaitAll<T>
impl<T> Move for WaitAll<T>
impl<T> Send for WaitAll<T>
impl<T> Sync for WaitAll<T>
impl<T> Unpin for WaitAll<T>
impl<T> UnsafeUnpin for WaitAll<T>
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
Source§impl<F> IntoFuture for Fwhere
F: Future,
impl<F> IntoFuture for Fwhere
F: Future,
Source§type IntoFuture = F
type IntoFuture = F
Which kind of future are we turning this into?
Source§fn into_future(self) -> <F as IntoFuture>::IntoFuture
fn into_future(self) -> <F as IntoFuture>::IntoFuture
Creates a future from a value. Read more