46
46
extern crate futures;
47
47
#[ cfg( feature = "mio-evented" ) ]
48
48
extern crate mio;
49
+ #[ cfg( not( target_os = "wasi" ) ) ]
49
50
extern crate nix;
50
51
#[ cfg( feature = "use_tokio" ) ]
51
52
extern crate tokio;
@@ -56,6 +57,7 @@ use std::io;
56
57
use std:: io:: prelude:: * ;
57
58
#[ cfg( any( target_os = "linux" , target_os = "android" , feature = "use_tokio" ) ) ]
58
59
use std:: io:: SeekFrom ;
60
+ #[ cfg( not( target_os = "wasi" ) ) ]
59
61
use std:: os:: unix:: prelude:: * ;
60
62
use std:: path:: Path ;
61
63
@@ -67,6 +69,7 @@ use mio::unix::EventedFd;
67
69
use mio:: Evented ;
68
70
#[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
69
71
use nix:: sys:: epoll:: * ;
72
+ #[ cfg( not( target_os = "wasi" ) ) ]
70
73
use nix:: unistd:: close;
71
74
#[ cfg( feature = "use_tokio" ) ]
72
75
use tokio:: reactor:: { Handle , PollEvented } ;
@@ -451,6 +454,7 @@ impl Pin {
451
454
/// This pin poller object will register an interrupt with the
452
455
/// kernel and allow you to poll() on it and receive notifications
453
456
/// that an interrupt has occured with minimal delay.
457
+ #[ cfg( not( target_os = "wasi" ) ) ]
454
458
pub fn get_poller ( & self ) -> Result < PinPoller > {
455
459
PinPoller :: new ( self . pin_num )
456
460
}
@@ -537,14 +541,14 @@ fn extract_pin_fom_path_test() {
537
541
let err2 = Pin :: extract_pin_from_path ( & "/sys/class/gpio/gpioSDS" ) ;
538
542
assert_eq ! ( true , err2. is_err( ) ) ;
539
543
}
540
-
544
+ # [ cfg ( not ( target_os = "wasi" ) ) ]
541
545
#[ derive( Debug ) ]
542
546
pub struct PinPoller {
543
547
pin_num : u64 ,
544
548
epoll_fd : RawFd ,
545
549
devfile : File ,
546
550
}
547
-
551
+ # [ cfg ( not ( target_os = "wasi" ) ) ]
548
552
impl PinPoller {
549
553
/// Get the pin associated with this PinPoller
550
554
///
@@ -615,6 +619,7 @@ impl PinPoller {
615
619
}
616
620
}
617
621
622
+ #[ cfg( not( target_os = "wasi" ) ) ]
618
623
impl Drop for PinPoller {
619
624
fn drop ( & mut self ) {
620
625
// we implement drop to close the underlying epoll fd as
0 commit comments