pub struct OneshotReceiver<T>(/* private fields */);Expand description
一次性接收端(recv 消费自身)。
Implementations§
Source§impl<T> OneshotReceiver<T>
impl<T> OneshotReceiver<T>
Sourcepub fn recv(self) -> Result<T, OneshotErr>
pub fn recv(self) -> Result<T, OneshotErr>
无限期等待;Err(OneshotErr::Closed) = 发送端先消失。
Sourcepub fn recv_timeout(self, d: Duration) -> Result<T, OneshotErr>
pub fn recv_timeout(self, d: Duration) -> Result<T, OneshotErr>
带时限等待。
Auto Trait Implementations§
impl<T> !Sync for OneshotReceiver<T>
impl<T> Freeze for OneshotReceiver<T>
impl<T> RefUnwindSafe for OneshotReceiver<T>where
Receiver<T>: RefUnwindSafe,
impl<T> Send for OneshotReceiver<T>
impl<T> Unpin for OneshotReceiver<T>
impl<T> UnsafeUnpin for OneshotReceiver<T>where
Receiver<T>: UnsafeUnpin,
impl<T> UnwindSafe for OneshotReceiver<T>where
Receiver<T>: UnwindSafe,
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