pub fn wait(&self, events: &mut [Event], timeout: Timeout) -> io::Result<usize> {
        let timeout = match timeout {
            Timeout::Indefinite => -1,
            Timeout::Immediate => 0,
            Timeout::Milliseconds(amount) => {
                if amount >= std::i32::MAX as usize {
                    std::i32::MAX
                }
                else {
                    amount as i32
                }
            }
        };

        let rc = unsafe {
            ffi::epoll_wait(self.fd, 
                             events.as_mut_ptr(),
                             events.len() as libc::c_int,
                             timeout)
        };

        if rc < 0 {
            Err(Error::last_os_error())
        }
        else {
            Ok(rc as usize)
        }
    }
/// Waits for an event.
/// 
/// `events` is an output parameter, which indicates the amount of events the user
/// is currently able to accept.
/// The return value is the amount that are ready to be processed, and is in the range 0...events.len().
///
/// # Example
/// ```no-run
/// let mut events = [Event::default(); 3];
/// let interfaces = e.wait(&mut events, Timeout::Indefinite)?;
/// for e in &events[..interfaces] {
///     // ...
/// }
/// ```
Waits for an event.
`events` is an output parameter, which indicates the amount of events the user
is currently able to accept.
The return value is the amount that are ready to be processed, and is in the range 0...events.len().
Waits for an event . ` events ` is an output parameter which indicates the amount of events the user is currently able to accept . The return value is the amount that are ready to be processed and is in the range 0 ... events . len () .
pub fn wait(&self, events: &mut [Event], timeout: Timeout) -> io::Result<usize> {
        let timeout = match timeout {
            Timeout::Indefinite => -1,
            Timeout::Immediate => 0,
            Timeout::Milliseconds(amount) => {
                if amount >= std::i32::MAX as usize {
                    std::i32::MAX
                }
                else {
                    amount as i32
                }
            }
        };
        let rc = unsafe {
            ffi::epoll_wait(self.fd, 
                             events.as_mut_ptr(),
                             events.len() as libc::c_int,
                             timeout)
        };
        if rc < 0 {
            Err(Error::last_os_error())
        }
        else {
            Ok(rc as usize)
        }
    }
pub fn wait ( & self , events : & mut [ Event ] , timeout : Timeout ) -> io :: Result < usize > { let timeout = match timeout { Timeout :: Indefinite => - 1 , Timeout :: Immediate => 0 , Timeout :: Milliseconds ( amount ) => { if amount >= std :: i32 :: MAX as usize { std :: i32 :: MAX } else { amount as i32 } } } ; let rc = unsafe { ffi :: epoll_wait ( self . fd , events . as_mut_ptr ( ) , events . len ( ) as libc :: c_int , timeout ) } ; if rc < 0 { Err ( Error :: last_os_error ( ) ) } else { Ok ( rc as usize ) } }
Waits for an event.
Waits for an event .
&self
events
&mut [Event]
timeout
Timeout
&self
events
&mut [Event]
timeout
Timeout
example
```no-run
let mut events = [Event::default(); 3];
let interfaces = e.wait(&mut events, Timeout::Indefinite)?;
for e in &events[..interfaces] {

}
```
` ` ` no - run let mut events = [ Event :: default () ; 3 ] ; let interfaces = e . wait ( &mut events Timeout :: Indefinite ) ? ; for e in &events [ .. interfaces ] { } ` ` `