pub struct Receiver<T> { /* private fields */ }
Expand description
Mock implementation of std::sync::mpsc::Receiver
.
Implementations§
source§impl<T> Receiver<T>
impl<T> Receiver<T>
sourcepub fn recv(&self) -> Result<T, RecvError>
pub fn recv(&self) -> Result<T, RecvError>
Attempts to wait for a value on this receiver, returning an error if the corresponding channel has hung up.
sourcepub fn recv_timeout(&self, _timeout: Duration) -> Result<T, RecvTimeoutError>
pub fn recv_timeout(&self, _timeout: Duration) -> Result<T, RecvTimeoutError>
Attempts to wait for a value on this receiver, returning an error if the
corresponding channel has hung up, or if it waits more than timeout
.
sourcepub fn try_recv(&self) -> Result<T, TryRecvError>
pub fn try_recv(&self) -> Result<T, TryRecvError>
Attempts to return a pending value on this receiver without blocking.
Trait Implementations§
Auto Trait Implementations§
impl<T> RefUnwindSafe for Receiver<T>
impl<T> Send for Receiver<T>where T: Send,
impl<T> !Sync for Receiver<T>
impl<T> Unpin for Receiver<T>
impl<T> UnwindSafe for Receiver<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