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

Add type alias BoxFusedStream #2186

Closed
wants to merge 1 commit into from
Closed
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
9 changes: 9 additions & 0 deletions futures-core/src/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,15 @@ where
}
}

/// An owned dynamically typed [`FusedStream`] for use in cases where you can't
/// statically type your result or need to add some indirection.
#[cfg(feature = "alloc")]
pub type BoxFusedStream<'a, T> = Pin<alloc::boxed::Box<dyn FusedStream<Item = T> + Send + 'a>>;

/// `BoxFusedStream`, but without the `Send` requirement.
#[cfg(feature = "alloc")]
pub type LocalBoxFusedStream<'a, T> = Pin<alloc::boxed::Box<dyn FusedStream<Item = T> + 'a>>;

/// A stream which tracks whether or not the underlying stream
/// should no longer be polled.
///
Expand Down