pub trait RecvTimeout<T> {
// Required method
fn recv_maybe_timeout(
&self,
timeout: Option<Duration>
) -> Result<T, RecvError>;
// Provided methods
fn recv(&self) -> Option<T> { ... }
fn recv_timeout(&self, timeout: Duration) -> Result<T, RecvError> { ... }
fn try_recv(&self) -> Result<T, TryRecvError> { ... }
}
Receive a message from the channel.
In case the channel was closed or the current fiber was cancelled the
function returns None
.
This function may perform a yield in case there is no message ready.