Skip to content

Commit

Permalink
impl FusedStream for Receiver (Fixes #3) (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
fogti authored Jan 11, 2021
1 parent 79cbf4e commit 21affd9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -793,6 +793,12 @@ impl<T> Stream for Receiver<T> {
}
}

impl<T> futures_core::stream::FusedStream for Receiver<T> {
fn is_terminated(&self) -> bool {
self.channel.queue.is_closed() && self.channel.queue.is_empty()
}
}

/// An error returned from [`Sender::send()`].
///
/// Received because the channel is closed.
Expand Down

0 comments on commit 21affd9

Please sign in to comment.