File tree Expand file tree Collapse file tree 3 files changed +18
-6
lines changed
Expand file tree Collapse file tree 3 files changed +18
-6
lines changed Original file line number Diff line number Diff line change @@ -137,7 +137,8 @@ extension_trait! {
137137 #[ doc = r#"
138138 Waits for one of two similarly-typed futures to complete.
139139
140- Awaits multiple futures simultaneously, returning all results once complete.
140+ Awaits multiple futures simultaneously, returning the output of the
141+ first future that completes.
141142
142143 This function will return a new future which awaits for either one of both
143144 futures to complete. If multiple futures are completed at the same time,
@@ -184,7 +185,10 @@ extension_trait! {
184185
185186 `try_select` is similar to [`select`], but keeps going if a future
186187 resolved to an error until all futures have been resolved. In which case
187- the error of the `other` future will be returned.
188+ an error is returned.
189+
190+ The ordering of which value is yielded when two futures resolve
191+ simultaneously is intentionally left unspecified.
188192
189193 # Examples
190194
Original file line number Diff line number Diff line change 11use std:: pin:: Pin ;
22
3- use pin_project_lite:: pin_project;
43use async_macros:: MaybeDone ;
4+ use pin_project_lite:: pin_project;
55
6- use std:: future:: Future ;
76use crate :: task:: { Context , Poll } ;
7+ use std:: future:: Future ;
88
99pin_project ! {
1010 #[ allow( missing_docs) ]
1111 #[ allow( missing_debug_implementations) ]
12- pub struct Select <L , R > where L : Future , R : Future <Output = L :: Output > {
12+ pub struct Select <L , R >
13+ where
14+ L : Future ,
15+ R : Future <Output = L :: Output >
16+ {
1317 #[ pin] left: MaybeDone <L >,
1418 #[ pin] right: MaybeDone <R >,
1519 }
Original file line number Diff line number Diff line change @@ -9,7 +9,11 @@ use std::future::Future;
99pin_project ! {
1010 #[ allow( missing_docs) ]
1111 #[ allow( missing_debug_implementations) ]
12- pub struct TrySelect <L , R > where L : Future , R : Future <Output = L :: Output > {
12+ pub struct TrySelect <L , R >
13+ where
14+ L : Future ,
15+ R : Future <Output = L :: Output >
16+ {
1317 #[ pin] left: MaybeDone <L >,
1418 #[ pin] right: MaybeDone <R >,
1519 }
You can’t perform that action at this time.
0 commit comments