diff options
author | Carl Lerche <me@carllerche.com> | 2020-01-23 13:24:30 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-23 13:24:30 -0800 |
commit | 7079bcd60975f592e08fcd575991f6ae2a409a1f (patch) | |
tree | b4dc701039f9a8d984fa9d5b3835b8094d6359f1 /tokio/src/future/maybe_done.rs | |
parent | f8714e9901981d5d1cc66c9a03d5a8a0b2f2eb4b (diff) |
future: provide join! macro (#2158)
Provides a `join!` macro that supports concurrently driving multiple
futures on the same task and await the completion of all futures.
Diffstat (limited to 'tokio/src/future/maybe_done.rs')
-rw-r--r-- | tokio/src/future/maybe_done.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tokio/src/future/maybe_done.rs b/tokio/src/future/maybe_done.rs index 5011544c..94b829f2 100644 --- a/tokio/src/future/maybe_done.rs +++ b/tokio/src/future/maybe_done.rs @@ -7,7 +7,7 @@ use std::task::{Context, Poll}; /// A future that may have completed. #[derive(Debug)] -pub(crate) enum MaybeDone<Fut: Future> { +pub enum MaybeDone<Fut: Future> { /// A not-yet-completed future Future(Fut), /// The output of the completed future @@ -21,7 +21,7 @@ pub(crate) enum MaybeDone<Fut: Future> { impl<Fut: Future + Unpin> Unpin for MaybeDone<Fut> {} /// Wraps a future into a `MaybeDone` -pub(crate) fn maybe_done<Fut: Future>(future: Fut) -> MaybeDone<Fut> { +pub fn maybe_done<Fut: Future>(future: Fut) -> MaybeDone<Fut> { MaybeDone::Future(future) } @@ -43,7 +43,7 @@ impl<Fut: Future> MaybeDone<Fut> { /// Attempt to take the output of a `MaybeDone` without driving it /// towards completion. #[inline] - pub(crate) fn take_output(self: Pin<&mut Self>) -> Option<Fut::Output> { + pub fn take_output(self: Pin<&mut Self>) -> Option<Fut::Output> { unsafe { let this = self.get_unchecked_mut(); match this { |