We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 155256c commit 012f6b6Copy full SHA for 012f6b6
src/future/into_future.rs
@@ -0,0 +1,13 @@
1
+use crate::future::Future;
2
+
3
+/// Convert a type into a `Future`.
4
+pub trait IntoFuture {
5
+ /// The type of value produced on completion.
6
+ type Output;
7
8
+ /// Which kind of future are we turning this into?
9
+ type Future: Future<Output = Self::Output>;
10
11
+ /// Create a future from a value
12
+ fn into_future(self) -> Self::Future;
13
+}
src/future/mod.rs
@@ -53,7 +53,9 @@ use cfg_if::cfg_if;
53
pub use pending::pending;
54
pub use poll_fn::poll_fn;
55
pub use ready::ready;
56
+pub use into_future::IntoFuture;
57
58
+mod into_future;
59
mod pending;
60
mod poll_fn;
61
mod ready;
0 commit comments