pub fn poll(&mut self) -> Result<Vec<T>, String> {
        let finished_events = loop {
            let results = poll_kevents_from_q(self.fd, &self.wait_timeout)?;
            if results.len() > 0 {
                break results;
            }
        };

        let mut indexes = Vec::with_capacity(8);
        for event in finished_events {
            let index =
                self.events
                    .iter()
                    .position(|ev| ev.get_ident() == event.ident);
            if let Some(idx) = index {
                indexes.push(idx)
            }
        }

        let mut events = Vec::with_capacity(8);
        for index in indexes {
            events.push(self.events.remove(index))
        }
        Ok(events)
    }
/// Polls the q and retrieves the ready events
Polls the q and retrieves the ready events
Polls the q and retrieves the ready events
pub fn poll(&mut self) -> Result<Vec<T>, String> {
        let finished_events = loop {
            let results = poll_kevents_from_q(self.fd, &self.wait_timeout)?;
            if results.len() > 0 {
                break results;
            }
        };
        let mut indexes = Vec::with_capacity(8);
        for event in finished_events {
            let index =
                self.events
                    .iter()
                    .position(|ev| ev.get_ident() == event.ident);
            if let Some(idx) = index {
                indexes.push(idx)
            }
        }
        let mut events = Vec::with_capacity(8);
        for index in indexes {
            events.push(self.events.remove(index))
        }
        Ok(events)
    }
pub fn poll ( & mut self ) -> Result < Vec < T > , String > { let finished_events = loop { let results = poll_kevents_from_q ( self . fd , & self . wait_timeout ) ? ; if results . len ( ) > 0 { break results ; } } ; let mut indexes = Vec :: with_capacity ( 8 ) ; for event in finished_events { let index = self . events . iter ( ) . position ( | ev | ev . get_ident ( ) == event . ident ) ; if let Some ( idx ) = index { indexes . push ( idx ) } } let mut events = Vec :: with_capacity ( 8 ) ; for index in indexes { events . push ( self . events . remove ( index ) ) } Ok ( events ) }
Polls the q and retrieves the ready events
Polls the q and retrieves the ready events
&mut self
&mut self