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(debug_assertions)]
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_io_source! {
48     #[cfg(debug_assertions)]
49     impl Selector {
50         pub fn id(&self) -> usize {
51             os_required!();
52         }
53     }
54 }
55 
56 #[cfg(unix)]
57 impl AsRawFd for Selector {
as_raw_fd(&self) -> RawFd58     fn as_raw_fd(&self) -> RawFd {
59         os_required!()
60     }
61 }
62 
63 #[allow(clippy::trivially_copy_pass_by_ref)]
64 pub mod event {
65     use crate::sys::Event;
66     use crate::Token;
67     use std::fmt;
68 
token(_: &Event) -> Token69     pub fn token(_: &Event) -> Token {
70         os_required!();
71     }
72 
is_readable(_: &Event) -> bool73     pub fn is_readable(_: &Event) -> bool {
74         os_required!();
75     }
76 
is_writable(_: &Event) -> bool77     pub fn is_writable(_: &Event) -> bool {
78         os_required!();
79     }
80 
is_error(_: &Event) -> bool81     pub fn is_error(_: &Event) -> bool {
82         os_required!();
83     }
84 
is_read_closed(_: &Event) -> bool85     pub fn is_read_closed(_: &Event) -> bool {
86         os_required!();
87     }
88 
is_write_closed(_: &Event) -> bool89     pub fn is_write_closed(_: &Event) -> bool {
90         os_required!();
91     }
92 
is_priority(_: &Event) -> bool93     pub fn is_priority(_: &Event) -> bool {
94         os_required!();
95     }
96 
is_aio(_: &Event) -> bool97     pub fn is_aio(_: &Event) -> bool {
98         os_required!();
99     }
100 
is_lio(_: &Event) -> bool101     pub fn is_lio(_: &Event) -> bool {
102         os_required!();
103     }
104 
debug_details(_: &mut fmt::Formatter<'_>, _: &Event) -> fmt::Result105     pub fn debug_details(_: &mut fmt::Formatter<'_>, _: &Event) -> fmt::Result {
106         os_required!();
107     }
108 }
109