diff --git a/futures-core/src/future.rs b/futures-core/src/future.rs index 7540cd027..6c60216fd 100644 --- a/futures-core/src/future.rs +++ b/futures-core/src/future.rs @@ -16,6 +16,16 @@ pub type BoxFuture<'a, T> = Pin + Send #[cfg(feature = "alloc")] pub type LocalBoxFuture<'a, T> = Pin + 'a>>; +/// [`BoxFuture`] with [`TryFuture`] instead. +#[cfg(feature = "alloc")] +pub type BoxTryFuture<'a, T, E> = + Pin> + Send + 'a>>; + +/// [`BoxTryFuture`], but without the `Send` requirement. +#[cfg(feature = "alloc")] +pub type LocalBoxTryFuture<'a, T, E> = + Pin> + 'a>>; + /// A future which tracks whether or not the underlying future /// should no longer be polled. /// diff --git a/futures-core/src/stream.rs b/futures-core/src/stream.rs index ad5350b79..921cccad1 100644 --- a/futures-core/src/stream.rs +++ b/futures-core/src/stream.rs @@ -13,6 +13,16 @@ pub type BoxStream<'a, T> = Pin + Send + #[cfg(feature = "alloc")] pub type LocalBoxStream<'a, T> = Pin + 'a>>; +/// [`BoxStream`] with [`TryStream`]. +#[cfg(feature = "alloc")] +pub type BoxTryStream<'a, T, E> = + Pin, Ok = T, Error = E> + Send + 'a>>; + +/// [`BoxTryStream`], but without the `Send` requirement. +#[cfg(feature = "alloc")] +pub type LocalBoxTryStream<'a, T, E> = + Pin, Ok = T, Error = E> + 'a>>; + /// A stream of values produced asynchronously. /// /// If `Future` is an asynchronous version of `T`, then `Stream