pub struct WaitOne<T> { /* private fields */ }Expand description
等待唯一交值方交来的值。
通过 wait_one 获得,完成结果为 RawResult<T, WaitError>。
值可在首次轮询(poll)前到达;唯一交值句柄无值释放时返回
WaitError::SenderDropped。放弃本值立即停止接收,不要求发送端同时释放。
同时只允许一个轮询者;完成后再次轮询会恐慌(panic)。
不要求 T: Unpin、Sync 或 'static;跨线程移动仍需 T: Send。
通知回调发生恐慌后,不保证可继续轮询;仍可放弃等待并清理自身原值责任。
Trait Implementations§
Auto Trait Implementations§
impl<T> !RefUnwindSafe for WaitOne<T>
impl<T> !UnwindSafe for WaitOne<T>
impl<T> Forget for WaitOne<T>
impl<T> Freeze for WaitOne<T>
impl<T> Move for WaitOne<T>
impl<T> Send for WaitOne<T>
impl<T> Sync for WaitOne<T>
impl<T> Unpin for WaitOne<T>
impl<T> UnsafeUnpin for WaitOne<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<Fut> FutureExt for Fut
impl<Fut> FutureExt for Fut
Source§fn attach<A>(self, attachment: A) -> FutureWithAttachment<Fut, A> ⓘwhere
A: Attachment,
fn attach<A>(self, attachment: A) -> FutureWithAttachment<Fut, A> ⓘwhere
A: Attachment,
Source§fn attach_with<A, F>(self, attachment: F) -> FutureWithLazyAttachment<Fut, F> ⓘwhere
A: Attachment,
F: FnOnce() -> A,
fn attach_with<A, F>(self, attachment: F) -> FutureWithLazyAttachment<Fut, F> ⓘwhere
A: Attachment,
F: FnOnce() -> A,
Source§fn attach_opaque<A>(self, attachment: A) -> FutureWithOpaqueAttachment<Fut, A> ⓘwhere
A: OpaqueAttachment,
fn attach_opaque<A>(self, attachment: A) -> FutureWithOpaqueAttachment<Fut, A> ⓘwhere
A: OpaqueAttachment,
Source§fn attach_opaque_with<A, F>(
self,
attachment: F,
) -> FutureWithLazyOpaqueAttachment<Fut, F> ⓘwhere
A: OpaqueAttachment,
F: FnOnce() -> A,
fn attach_opaque_with<A, F>(
self,
attachment: F,
) -> FutureWithLazyOpaqueAttachment<Fut, F> ⓘwhere
A: OpaqueAttachment,
F: FnOnce() -> A,
Source§fn change_context<C>(self, context: C) -> FutureWithContext<Fut, C> ⓘ
fn change_context<C>(self, context: C) -> FutureWithContext<Fut, C> ⓘ
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