fn init(&mut self, ops: &mut EventOps) {
        if self.input.is_some() && self.serial.events().buffer_ready_event_fd.is_some() {
            let serial_fd = self.serial_input_fd();
            let buf_ready_evt = self.buffer_ready_evt_fd();
            if serial_fd != -1 {
                if let Err(e) = ops.add(Events::new(&serial_fd, EventSet::IN)) {
                    warn!("Failed to register serial input fd: {}", e);
                }
            }
            if let Err(e) = ops.add(Events::new(&buf_ready_evt, EventSet::IN)) {
                warn!("Failed to register serial buffer ready event: {}", e);
            }
        }
    }
/// Initial registration of pollable objects.
/// If serial input is present, register the serial input FD as readable.
Initial registration of pollable objects.
If serial input is present, register the serial input FD as readable.
Initial registration of pollable objects . If serial input is present register the serial input FD as readable .
fn init(&mut self, ops: &mut EventOps) {
        if self.input.is_some() && self.serial.events().buffer_ready_event_fd.is_some() {
            let serial_fd = self.serial_input_fd();
            let buf_ready_evt = self.buffer_ready_evt_fd();
            if serial_fd != -1 {
                if let Err(e) = ops.add(Events::new(&serial_fd, EventSet::IN)) {
                    warn!("Failed to register serial input fd: {}", e);
                }
            }
            if let Err(e) = ops.add(Events::new(&buf_ready_evt, EventSet::IN)) {
                warn!("Failed to register serial buffer ready event: {}", e);
            }
        }
    }
fn init ( & mut self , ops : & mut EventOps ) { if self . input . is_some ( ) && self . serial . events ( ) . buffer_ready_event_fd . is_some ( ) { let serial_fd = self . serial_input_fd ( ) ; let buf_ready_evt = self . buffer_ready_evt_fd ( ) ; if serial_fd != - 1 { if let Err ( e ) = ops . add ( Events :: new ( & serial_fd , EventSet :: IN ) ) { warn ! ( " " e ) ; } } if let Err ( e ) = ops . add ( Events :: new ( & buf_ready_evt , EventSet :: IN ) ) { warn ! ( " " e ) ; } } }
Initial registration of pollable objects.
Initial registration of pollable objects .
&mut self
ops
&mut EventOps
&mut self
ops
&mut EventOps