pub fn add(&mut self, event: T) -> Result<(), T> {
        self.events.push(event);
        let kevent = self.events.last().unwrap().get_kevent();
        let worked = put_kevent_in_kqueue(self.fd, &kevent, &self.wait_timeout);
        if let Err(err) = worked {
            println!("{}", err);
            return Err(self.events.remove(self.events.len() - 1));
        }
        Ok(())
    }
/// Adds a given element into the kqueue
Adds a given element into the kqueue
Adds a given element into the kqueue
pub fn add(&mut self, event: T) -> Result<(), T> {
        self.events.push(event);
        let kevent = self.events.last().unwrap().get_kevent();
        let worked = put_kevent_in_kqueue(self.fd, &kevent, &self.wait_timeout);
        if let Err(err) = worked {
            println!("{}", err);
            return Err(self.events.remove(self.events.len() - 1));
        }
        Ok(())
    }
pub fn add ( & mut self , event : T ) -> Result < ( ) , T > { self . events . push ( event ) ; let kevent = self . events . last ( ) . unwrap ( ) . get_kevent ( ) ; let worked = put_kevent_in_kqueue ( self . fd , & kevent , & self . wait_timeout ) ; if let Err ( err ) = worked { println ! ( " " err ) ; return Err ( self . events . remove ( self . events . len ( ) - 1 ) ) ; } Ok ( ( ) ) }
Adds a given element into the kqueue
Adds a given element into the kqueue
&mut self
event
T
&mut self
event
T