File tree Expand file tree Collapse file tree 24 files changed +1670
-90
lines changed Expand file tree Collapse file tree 24 files changed +1670
-90
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ futures-preview = "0.3.0-alpha.17"
26
26
futures-timer = " 0.3.0"
27
27
lazy_static = " 1.3.0"
28
28
log = { version = " 0.4.8" , features = [" kv_unstable" ] }
29
+ memchr = " 2.2.1"
29
30
mio = " 0.6.19"
30
31
mio-uds = " 0.6.7"
31
32
num_cpus = " 1.10.0"
Original file line number Diff line number Diff line change @@ -483,7 +483,7 @@ impl File {
483
483
}
484
484
}
485
485
486
- impl AsyncRead for File {
486
+ impl futures :: io :: AsyncRead for File {
487
487
fn poll_read (
488
488
self : Pin < & mut Self > ,
489
489
cx : & mut Context < ' _ > ,
@@ -498,7 +498,7 @@ impl AsyncRead for File {
498
498
}
499
499
}
500
500
501
- impl AsyncRead for & File {
501
+ impl futures :: io :: AsyncRead for & File {
502
502
fn poll_read (
503
503
mut self : Pin < & mut Self > ,
504
504
cx : & mut Context < ' _ > ,
@@ -564,7 +564,7 @@ impl AsyncRead for &File {
564
564
}
565
565
}
566
566
567
- impl AsyncWrite for File {
567
+ impl futures :: io :: AsyncWrite for File {
568
568
fn poll_write (
569
569
self : Pin < & mut Self > ,
570
570
cx : & mut Context < ' _ > ,
@@ -582,7 +582,7 @@ impl AsyncWrite for File {
582
582
}
583
583
}
584
584
585
- impl AsyncWrite for & File {
585
+ impl futures :: io :: AsyncWrite for & File {
586
586
fn poll_write (
587
587
mut self : Pin < & mut Self > ,
588
588
cx : & mut Context < ' _ > ,
@@ -693,7 +693,7 @@ impl AsyncWrite for &File {
693
693
}
694
694
}
695
695
696
- impl AsyncSeek for File {
696
+ impl futures :: io :: AsyncSeek for File {
697
697
fn poll_seek (
698
698
self : Pin < & mut Self > ,
699
699
cx : & mut Context < ' _ > ,
Original file line number Diff line number Diff line change 3
3
#[ doc( inline) ]
4
4
pub use std:: future:: Future ;
5
5
6
- /// Never resolves to a value.
7
- ///
8
- /// # Examples
9
- /// ```
10
- /// # #![feature(async_await)]
11
- /// # fn main() { async_std::task::block_on(async {
12
- /// #
13
- /// use async_std::future::pending;
14
- /// use async_std::prelude::*;
15
- /// use std::time::Duration;
16
- ///
17
- /// let dur = Duration::from_secs(1);
18
- /// assert!(pending::<()>().timeout(dur).await.is_err());
19
- /// #
20
- /// # }) }
21
- /// ```
22
- pub async fn pending < T > ( ) -> T {
23
- futures:: future:: pending :: < T > ( ) . await
24
- }
6
+ pub use pending:: pending;
7
+ pub use ready:: ready;
25
8
26
- /// Resolves to the provided value.
27
- ///
28
- /// This function is an async version of [`std::convert::identity`].
29
- ///
30
- /// [`std::convert::identity`]: https://doc.rust-lang.org/std/convert/fn.identity.html
31
- ///
32
- /// # Examples
33
- ///
34
- /// ```
35
- /// # #![feature(async_await)]
36
- /// # fn main() { async_std::task::block_on(async {
37
- /// #
38
- /// use async_std::future::ready;
39
- ///
40
- /// assert_eq!(ready(10).await, 10);
41
- /// #
42
- /// # }) }
43
- /// ```
44
- pub async fn ready < T > ( val : T ) -> T {
45
- val
46
- }
9
+ mod pending;
10
+ mod ready;
Original file line number Diff line number Diff line change
1
+ /// Never resolves to a value.
2
+ ///
3
+ /// # Examples
4
+ /// ```
5
+ /// # #![feature(async_await)]
6
+ /// # fn main() { async_std::task::block_on(async {
7
+ /// #
8
+ /// use async_std::future::pending;
9
+ /// use async_std::prelude::*;
10
+ /// use std::time::Duration;
11
+ ///
12
+ /// let dur = Duration::from_secs(1);
13
+ /// assert!(pending::<()>().timeout(dur).await.is_err());
14
+ /// #
15
+ /// # }) }
16
+ /// ```
17
+ pub async fn pending < T > ( ) -> T {
18
+ futures:: future:: pending :: < T > ( ) . await
19
+ }
Original file line number Diff line number Diff line change
1
+ /// Resolves to the provided value.
2
+ ///
3
+ /// This function is an async version of [`std::convert::identity`].
4
+ ///
5
+ /// [`std::convert::identity`]: https://doc.rust-lang.org/std/convert/fn.identity.html
6
+ ///
7
+ /// # Examples
8
+ ///
9
+ /// ```
10
+ /// # #![feature(async_await)]
11
+ /// # fn main() { async_std::task::block_on(async {
12
+ /// #
13
+ /// use async_std::future::ready;
14
+ ///
15
+ /// assert_eq!(ready(10).await, 10);
16
+ /// #
17
+ /// # }) }
18
+ /// ```
19
+ pub async fn ready < T > ( val : T ) -> T {
20
+ val
21
+ }
You can’t perform that action at this time.
0 commit comments