Skip to content

Commit 2fa7bab

Browse files
stepanchegtaiki-e
authored andcommitted
Add Receiver::try_next return value descriptions
Similar change applied to `UnboundedReceiver::try_next` a few commits ago.
1 parent 4d2ad0e commit 2fa7bab

File tree

1 file changed

+5
-0
lines changed
  • futures-channel/src/mpsc

1 file changed

+5
-0
lines changed

futures-channel/src/mpsc/mod.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1020,6 +1020,11 @@ impl<T> Receiver<T> {
10201020
/// It is not recommended to call this function from inside of a future,
10211021
/// only when you've otherwise arranged to be notified when the channel is
10221022
/// no longer empty.
1023+
///
1024+
/// This function returns:
1025+
/// * `Ok(Some(t))` when message is fetched
1026+
/// * `Ok(None)` when channel is closed and no messages left in the queue
1027+
/// * `Err(e)` when there are no messages available, but channel is not yet closed
10231028
pub fn try_next(&mut self) -> Result<Option<T>, TryRecvError> {
10241029
match self.next_message() {
10251030
Poll::Ready(msg) => {

0 commit comments

Comments
 (0)