|
|
@ -1,24 +1,22 @@
|
|
|
|
cfg_unstable! {
|
|
|
|
mod delay;
|
|
|
|
mod delay;
|
|
|
|
mod flatten;
|
|
|
|
mod flatten;
|
|
|
|
mod race;
|
|
|
|
mod race;
|
|
|
|
mod try_race;
|
|
|
|
mod try_race;
|
|
|
|
mod join;
|
|
|
|
mod join;
|
|
|
|
mod try_join;
|
|
|
|
mod try_join;
|
|
|
|
|
|
|
|
|
|
|
|
use std::time::Duration;
|
|
|
|
use std::time::Duration;
|
|
|
|
use delay::DelayFuture;
|
|
|
|
use delay::DelayFuture;
|
|
|
|
use flatten::FlattenFuture;
|
|
|
|
use flatten::FlattenFuture;
|
|
|
|
use race::Race;
|
|
|
|
use crate::future::IntoFuture;
|
|
|
|
use try_race::TryRace;
|
|
|
|
use race::Race;
|
|
|
|
use join::Join;
|
|
|
|
use try_race::TryRace;
|
|
|
|
use try_join::TryJoin;
|
|
|
|
use join::Join;
|
|
|
|
|
|
|
|
use try_join::TryJoin;
|
|
|
|
#[cfg(feature = "default")]
|
|
|
|
}
|
|
|
|
use crate::future::timeout::TimeoutFuture;
|
|
|
|
|
|
|
|
|
|
|
|
cfg_unstable_default! {
|
|
|
|
use crate::future::IntoFuture;
|
|
|
|
use crate::future::timeout::TimeoutFuture;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extension_trait! {
|
|
|
|
extension_trait! {
|
|
|
|
use core::pin::Pin;
|
|
|
|
use core::pin::Pin;
|
|
|
@ -151,8 +149,6 @@ extension_trait! {
|
|
|
|
/// dbg!(a.await);
|
|
|
|
/// dbg!(a.await);
|
|
|
|
/// # })
|
|
|
|
/// # })
|
|
|
|
/// ```
|
|
|
|
/// ```
|
|
|
|
#[cfg(feature = "unstable")]
|
|
|
|
|
|
|
|
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
|
|
|
|
|
|
|
|
fn delay(self, dur: Duration) -> impl Future<Output = Self::Output> [DelayFuture<Self>]
|
|
|
|
fn delay(self, dur: Duration) -> impl Future<Output = Self::Output> [DelayFuture<Self>]
|
|
|
|
where
|
|
|
|
where
|
|
|
|
Self: Sized,
|
|
|
|
Self: Sized,
|
|
|
@ -174,8 +170,6 @@ extension_trait! {
|
|
|
|
/// assert_eq!(future.await, 1);
|
|
|
|
/// assert_eq!(future.await, 1);
|
|
|
|
/// # })
|
|
|
|
/// # })
|
|
|
|
/// ```
|
|
|
|
/// ```
|
|
|
|
#[cfg(feature = "unstable")]
|
|
|
|
|
|
|
|
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
|
|
|
|
|
|
|
|
fn flatten(
|
|
|
|
fn flatten(
|
|
|
|
self,
|
|
|
|
self,
|
|
|
|
) -> impl Future<Output = <Self::Output as IntoFuture>::Output>
|
|
|
|
) -> impl Future<Output = <Self::Output as IntoFuture>::Output>
|
|
|
@ -216,8 +210,6 @@ extension_trait! {
|
|
|
|
# });
|
|
|
|
# });
|
|
|
|
```
|
|
|
|
```
|
|
|
|
"#]
|
|
|
|
"#]
|
|
|
|
#[cfg(feature = "unstable")]
|
|
|
|
|
|
|
|
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
|
|
|
|
|
|
|
|
fn race<F>(
|
|
|
|
fn race<F>(
|
|
|
|
self,
|
|
|
|
self,
|
|
|
|
other: F,
|
|
|
|
other: F,
|
|
|
@ -262,8 +254,6 @@ extension_trait! {
|
|
|
|
# Ok(()) }) }
|
|
|
|
# Ok(()) }) }
|
|
|
|
```
|
|
|
|
```
|
|
|
|
"#]
|
|
|
|
"#]
|
|
|
|
#[cfg(feature = "unstable")]
|
|
|
|
|
|
|
|
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
|
|
|
|
|
|
|
|
fn try_race<F, T, E>(
|
|
|
|
fn try_race<F, T, E>(
|
|
|
|
self,
|
|
|
|
self,
|
|
|
|
other: F
|
|
|
|
other: F
|
|
|
@ -299,8 +289,6 @@ extension_trait! {
|
|
|
|
# });
|
|
|
|
# });
|
|
|
|
```
|
|
|
|
```
|
|
|
|
"#]
|
|
|
|
"#]
|
|
|
|
#[cfg(any(feature = "unstable", feature = "docs"))]
|
|
|
|
|
|
|
|
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
|
|
|
|
|
|
|
|
fn join<F>(
|
|
|
|
fn join<F>(
|
|
|
|
self,
|
|
|
|
self,
|
|
|
|
other: F
|
|
|
|
other: F
|
|
|
@ -346,8 +334,6 @@ extension_trait! {
|
|
|
|
# Ok(()) }) }
|
|
|
|
# Ok(()) }) }
|
|
|
|
```
|
|
|
|
```
|
|
|
|
"#]
|
|
|
|
"#]
|
|
|
|
#[cfg(any(feature = "unstable", feature = "docs"))]
|
|
|
|
|
|
|
|
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
|
|
|
|
|
|
|
|
fn try_join<F, A, B, E>(
|
|
|
|
fn try_join<F, A, B, E>(
|
|
|
|
self,
|
|
|
|
self,
|
|
|
|
other: F
|
|
|
|
other: F
|
|
|
@ -385,8 +371,7 @@ extension_trait! {
|
|
|
|
# });
|
|
|
|
# });
|
|
|
|
```
|
|
|
|
```
|
|
|
|
"#]
|
|
|
|
"#]
|
|
|
|
#[cfg(any(all(feature = "default", feature = "unstable"), feature = "docs"))]
|
|
|
|
#[cfg(feature = "default")]
|
|
|
|
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
|
|
|
|
|
|
|
|
fn timeout(self, dur: Duration) -> impl Future<Output = Self::Output> [TimeoutFuture<Self>]
|
|
|
|
fn timeout(self, dur: Duration) -> impl Future<Output = Self::Output> [TimeoutFuture<Self>]
|
|
|
|
where Self: Sized
|
|
|
|
where Self: Sized
|
|
|
|
{
|
|
|
|
{
|
|
|
|