File tree Expand file tree Collapse file tree 3 files changed +8
-4
lines changed
Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -10,9 +10,9 @@ use futures_sink::Sink;
1010#[ derive( Debug , Clone ) ]
1111pub enum Either < A , B > {
1212 /// First branch of the type
13- Left ( A ) ,
13+ Left ( /* #[pin] */ A ) ,
1414 /// Second branch of the type
15- Right ( B ) ,
15+ Right ( /* #[pin] */ B ) ,
1616}
1717
1818impl < A , B > Either < A , B > {
Original file line number Diff line number Diff line change @@ -12,14 +12,16 @@ use futures_core::task::{Context, Poll};
1212#[ derive( Debug ) ]
1313pub enum MaybeDone < Fut : Future > {
1414 /// A not-yet-completed future
15- Future ( Fut ) ,
15+ Future ( /* #[pin] */ Fut ) ,
1616 /// The output of the completed future
1717 Done ( Fut :: Output ) ,
1818 /// The empty variant after the result of a [`MaybeDone`] has been
1919 /// taken using the [`take_output`](MaybeDone::take_output) method.
2020 Gone ,
2121}
2222
23+ impl < Fut : Future + Unpin > Unpin for MaybeDone < Fut > { }
24+
2325/// Wraps a future into a `MaybeDone`
2426///
2527/// # Examples
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ use futures_core::task::{Context, Poll};
1212#[ derive( Debug ) ]
1313pub enum TryMaybeDone < Fut : TryFuture > {
1414 /// A not-yet-completed future
15- Future ( Fut ) ,
15+ Future ( /* #[pin] */ Fut ) ,
1616 /// The output of the completed future
1717 Done ( Fut :: Ok ) ,
1818 /// The empty variant after the result of a [`TryMaybeDone`] has been
@@ -21,6 +21,8 @@ pub enum TryMaybeDone<Fut: TryFuture> {
2121 Gone ,
2222}
2323
24+ impl < Fut : TryFuture + Unpin > Unpin for TryMaybeDone < Fut > { }
25+
2426/// Wraps a future into a `TryMaybeDone`
2527pub fn try_maybe_done < Fut : TryFuture > ( future : Fut ) -> TryMaybeDone < Fut > {
2628 TryMaybeDone :: Future ( future)
You can’t perform that action at this time.
0 commit comments