4242//! }
4343//! ```
4444
45- #[ cfg( feature = "use_tokio " ) ]
45+ #[ cfg( feature = "async-tokio " ) ]
4646extern crate futures;
4747#[ cfg( feature = "mio-evented" ) ]
4848extern crate mio;
4949#[ cfg( not( target_os = "wasi" ) ) ]
5050extern crate nix;
51- #[ cfg( feature = "use_tokio " ) ]
51+ #[ cfg( feature = "async-tokio " ) ]
5252extern crate tokio;
5353
5454use std:: fs;
5555use std:: fs:: File ;
5656use std:: io;
5757use std:: io:: prelude:: * ;
58- #[ cfg( any( target_os = "linux" , target_os = "android" , feature = "use_tokio " ) ) ]
58+ #[ cfg( any( target_os = "linux" , target_os = "android" , feature = "async-tokio " ) ) ]
5959use std:: io:: SeekFrom ;
6060#[ cfg( not( target_os = "wasi" ) ) ]
6161use std:: os:: unix:: prelude:: * ;
6262use std:: path:: Path ;
6363
64- #[ cfg( feature = "use_tokio " ) ]
64+ #[ cfg( feature = "async-tokio " ) ]
6565use futures:: { Async , Poll , Stream } ;
6666#[ cfg( feature = "mio-evented" ) ]
6767use mio:: unix:: EventedFd ;
@@ -71,7 +71,7 @@ use mio::Evented;
7171use nix:: sys:: epoll:: * ;
7272#[ cfg( not( target_os = "wasi" ) ) ]
7373use nix:: unistd:: close;
74- #[ cfg( feature = "use_tokio " ) ]
74+ #[ cfg( feature = "async-tokio " ) ]
7575use tokio:: reactor:: { Handle , PollEvented } ;
7676
7777pub use error:: Error ;
@@ -126,7 +126,7 @@ fn flush_input_from_file(dev_file: &mut File, max: usize) -> io::Result<usize> {
126126}
127127
128128/// Get the pin value from the provided file
129- #[ cfg( any( target_os = "linux" , target_os = "android" , feature = "use_tokio " ) ) ]
129+ #[ cfg( any( target_os = "linux" , target_os = "android" , feature = "async-tokio " ) ) ]
130130fn get_value_from_file ( dev_file : & mut File ) -> Result < u8 > {
131131 let mut s = String :: with_capacity ( 10 ) ;
132132 dev_file. seek ( SeekFrom :: Start ( 0 ) ) ?;
@@ -475,8 +475,8 @@ impl Pin {
475475 /// The PinStream object can be used with the `tokio` crate. You should probably call
476476 /// `set_edge()` before using this.
477477 ///
478- /// This method is only available when the `use_tokio ` crate feature is enabled.
479- #[ cfg( feature = "use_tokio " ) ]
478+ /// This method is only available when the `async-tokio ` crate feature is enabled.
479+ #[ cfg( feature = "async-tokio " ) ]
480480 pub fn get_stream_with_handle ( & self , handle : & Handle ) -> Result < PinStream > {
481481 PinStream :: init_with_handle ( * self , handle)
482482 }
@@ -486,8 +486,8 @@ impl Pin {
486486 /// The PinStream object can be used with the `tokio` crate. You should probably call
487487 /// `set_edge()` before using this.
488488 ///
489- /// This method is only available when the `use_tokio ` crate feature is enabled.
490- #[ cfg( feature = "use_tokio " ) ]
489+ /// This method is only available when the `async-tokio ` crate feature is enabled.
490+ #[ cfg( feature = "async-tokio " ) ]
491491 pub fn get_stream ( & self ) -> Result < PinStream > {
492492 PinStream :: init ( * self )
493493 }
@@ -502,8 +502,8 @@ impl Pin {
502502 /// it could end up producing the same value multiple times if the value has changed back
503503 /// between when the interrupt occurred and when the value was read.
504504 ///
505- /// This method is only available when the `use_tokio ` crate feature is enabled.
506- #[ cfg( feature = "use_tokio " ) ]
505+ /// This method is only available when the `async-tokio ` crate feature is enabled.
506+ #[ cfg( feature = "async-tokio " ) ]
507507 pub fn get_value_stream_with_handle ( & self , handle : & Handle ) -> Result < PinValueStream > {
508508 Ok ( PinValueStream ( PinStream :: init_with_handle ( * self , handle) ?) )
509509 }
@@ -518,8 +518,8 @@ impl Pin {
518518 /// it could end up producing the same value multiple times if the value has changed back
519519 /// between when the interrupt occurred and when the value was read.
520520 ///
521- /// This method is only available when the `use_tokio ` crate feature is enabled.
522- #[ cfg( feature = "use_tokio " ) ]
521+ /// This method is only available when the `async-tokio ` crate feature is enabled.
522+ #[ cfg( feature = "async-tokio " ) ]
523523 pub fn get_value_stream ( & self ) -> Result < PinValueStream > {
524524 Ok ( PinValueStream ( PinStream :: init ( * self ) ?) )
525525 }
@@ -667,13 +667,13 @@ impl Evented for AsyncPinPoller {
667667 }
668668}
669669
670- #[ cfg( feature = "use_tokio " ) ]
670+ #[ cfg( feature = "async-tokio " ) ]
671671pub struct PinStream {
672672 evented : PollEvented < AsyncPinPoller > ,
673673 skipped_first_event : bool ,
674674}
675675
676- #[ cfg( feature = "use_tokio " ) ]
676+ #[ cfg( feature = "async-tokio " ) ]
677677impl PinStream {
678678 pub fn init_with_handle ( pin : Pin , handle : & Handle ) -> Result < Self > {
679679 Ok ( PinStream {
@@ -683,7 +683,7 @@ impl PinStream {
683683 }
684684}
685685
686- #[ cfg( feature = "use_tokio " ) ]
686+ #[ cfg( feature = "async-tokio " ) ]
687687impl PinStream {
688688 pub fn init ( pin : Pin ) -> Result < Self > {
689689 Ok ( PinStream {
@@ -693,7 +693,7 @@ impl PinStream {
693693 }
694694}
695695
696- #[ cfg( feature = "use_tokio " ) ]
696+ #[ cfg( feature = "async-tokio " ) ]
697697impl Stream for PinStream {
698698 type Item = ( ) ;
699699 type Error = Error ;
@@ -714,18 +714,18 @@ impl Stream for PinStream {
714714 }
715715}
716716
717- #[ cfg( feature = "use_tokio " ) ]
717+ #[ cfg( feature = "async-tokio " ) ]
718718pub struct PinValueStream ( PinStream ) ;
719719
720- #[ cfg( feature = "use_tokio " ) ]
720+ #[ cfg( feature = "async-tokio " ) ]
721721impl PinValueStream {
722722 #[ inline]
723723 fn get_value ( & mut self ) -> Result < u8 > {
724724 get_value_from_file ( & mut self . 0 . evented . get_mut ( ) . devfile )
725725 }
726726}
727727
728- #[ cfg( feature = "use_tokio " ) ]
728+ #[ cfg( feature = "async-tokio " ) ]
729729impl Stream for PinValueStream {
730730 type Item = u8 ;
731731 type Error = Error ;
0 commit comments