1 use std::io; 2 #[cfg(unix)] 3 use std::os::unix::io::{AsRawFd, RawFd}; 4 use std::time::Duration; 5 6 pub type Event = usize; 7 8 pub type Events = Vec<Event>; 9 10 #[derive(Debug)] 11 pub struct Selector {} 12 13 impl Selector { try_clone(&self) -> io::Result<Selector>14 pub fn try_clone(&self) -> io::Result<Selector> { 15 os_required!(); 16 } 17 select(&self, _: &mut Events, _: Option<Duration>) -> io::Result<()>18 pub fn select(&self, _: &mut Events, _: Option<Duration>) -> io::Result<()> { 19 os_required!(); 20 } 21 22 #[cfg(all(debug_assertions, not(target_os = "wasi")))] register_waker(&self) -> bool23 pub fn register_waker(&self) -> bool { 24 os_required!(); 25 } 26 } 27 28 #[cfg(unix)] 29 cfg_any_os_ext! { 30 use crate::{Interest, Token}; 31 32 impl Selector { 33 pub fn register(&self, _: RawFd, _: Token, _: Interest) -> io::Result<()> { 34 os_required!(); 35 } 36 37 pub fn reregister(&self, _: RawFd, _: Token, _: Interest) -> io::Result<()> { 38 os_required!(); 39 } 40 41 pub fn deregister(&self, _: RawFd) -> io::Result<()> { 42 os_required!(); 43 } 44 } 45 } 46 47 #[cfg(target_os = "wasi")] 48 cfg_any_os_ext! { 49 use crate::{Interest, Token}; 50 51 impl Selector { 52 pub fn register(&self, _: wasi::Fd, _: Token, _: Interest) -> io::Result<()> { 53 os_required!(); 54 } 55 56 pub fn reregister(&self, _: wasi::Fd, _: Token, _: Interest) -> io::Result<()> { 57 os_required!(); 58 } 59 60 pub fn deregister(&self, _: wasi::Fd) -> io::Result<()> { 61 os_required!(); 62 } 63 } 64 } 65 66 cfg_io_source! { 67 #[cfg(debug_assertions)] 68 impl Selector { 69 pub fn id(&self) -> usize { 70 os_required!(); 71 } 72 } 73 } 74 75 #[cfg(unix)] 76 impl AsRawFd for Selector { as_raw_fd(&self) -> RawFd77 fn as_raw_fd(&self) -> RawFd { 78 os_required!() 79 } 80 } 81 82 #[allow(clippy::trivially_copy_pass_by_ref)] 83 pub mod event { 84 use crate::sys::Event; 85 use crate::Token; 86 use std::fmt; 87 token(_: &Event) -> Token88 pub fn token(_: &Event) -> Token { 89 os_required!(); 90 } 91 is_readable(_: &Event) -> bool92 pub fn is_readable(_: &Event) -> bool { 93 os_required!(); 94 } 95 is_writable(_: &Event) -> bool96 pub fn is_writable(_: &Event) -> bool { 97 os_required!(); 98 } 99 is_error(_: &Event) -> bool100 pub fn is_error(_: &Event) -> bool { 101 os_required!(); 102 } 103 is_read_closed(_: &Event) -> bool104 pub fn is_read_closed(_: &Event) -> bool { 105 os_required!(); 106 } 107 is_write_closed(_: &Event) -> bool108 pub fn is_write_closed(_: &Event) -> bool { 109 os_required!(); 110 } 111 is_priority(_: &Event) -> bool112 pub fn is_priority(_: &Event) -> bool { 113 os_required!(); 114 } 115 is_aio(_: &Event) -> bool116 pub fn is_aio(_: &Event) -> bool { 117 os_required!(); 118 } 119 is_lio(_: &Event) -> bool120 pub fn is_lio(_: &Event) -> bool { 121 os_required!(); 122 } 123 debug_details(_: &mut fmt::Formatter<'_>, _: &Event) -> fmt::Result124 pub fn debug_details(_: &mut fmt::Formatter<'_>, _: &Event) -> fmt::Result { 125 os_required!(); 126 } 127 } 128