Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document cancel-safety of FuturesUnordered::poll_next #2897

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions futures-util/src/stream/futures_unordered/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,14 @@ use self::ready_to_run_queue::{Dequeue, ReadyToRunQueue};
///
/// This type is only available when the `std` or `alloc` feature of this
/// library is activated, and it is activated by default.
///
/// # Cancel safety
///
/// This type is cancellation-safe when the inner [`Future`] is
/// cancellation-safe. If the future type is cancellation-safe, and
/// [`poll_next`](Stream::poll_next) is called (either directly or via
/// [`crate::StreamExt::next`]) and returns [`Poll::Pending`], no values will be
/// dropped if `poll_next` is not called again.
#[must_use = "streams do nothing unless polled"]
pub struct FuturesUnordered<Fut> {
ready_to_run_queue: Arc<ReadyToRunQueue<Fut>>,
Expand Down
Loading