fn process(&mut self, event: &EpollEvent, _: &mut EventManager) {
        let source = event.fd();
        let event_set = event.event_set();

        // TODO: also check for errors. Pending high level discussions on how we want
        // to handle errors in devices.
        let supported_events = EventSet::IN;
        if !supported_events.contains(event_set) {
            warn!(
                "Received unknown event: {:?} from source: {:?}",
                event_set, source
            );
            return;
        }

        if let Some(input) = self.input.as_mut() {
            if input.as_raw_fd() == source {
                let mut out = [0u8; 32];
                match input.read(&mut out[..]) {
                    Ok(count) => {
                        self.raw_input(&out[..count])
                            .unwrap_or_else(|e| warn!("Serial error on input: {}", e));
                    }
                    Err(e) => {
                        warn!("error while reading stdin: {:?}", e);
                    }
                }
            }
        }
    }
/// Handle a read event (EPOLLIN) on the serial input fd.
Handle a read event (EPOLLIN) on the serial input fd.
Handle a read event ( EPOLLIN ) on the serial input fd .
fn process(&mut self, event: &EpollEvent, _: &mut EventManager) {
        let source = event.fd();
        let event_set = event.event_set();
        // TODO: also check for errors. Pending high level discussions on how we want
        // to handle errors in devices.
        let supported_events = EventSet::IN;
        if !supported_events.contains(event_set) {
            warn!(
                "Received unknown event: {:?} from source: {:?}",
                event_set, source
            );
            return;
        }
        if let Some(input) = self.input.as_mut() {
            if input.as_raw_fd() == source {
                let mut out = [0u8; 32];
                match input.read(&mut out[..]) {
                    Ok(count) => {
                        self.raw_input(&out[..count])
                            .unwrap_or_else(|e| warn!("Serial error on input: {}", e));
                    }
                    Err(e) => {
                        warn!("error while reading stdin: {:?}", e);
                    }
                }
            }
        }
    }
fn process ( & mut self , event : & EpollEvent , _ : & mut EventManager ) { let source = event . fd ( ) ; let event_set = event . event_set ( ) ; // TODO: also check for errors. Pending high level discussions on how we want // to handle errors in devices. let supported_events = EventSet :: IN ; if ! supported_events . contains ( event_set ) { warn ! ( " " event_set source ) ; return ; } if let Some ( input ) = self . input . as_mut ( ) { if input . as_raw_fd ( ) == source { let mut out = [ 0u8 ; 32 ] ; match input . read ( & mut out [ .. ] ) { Ok ( count ) => { self . raw_input ( & out [ .. count ] ) . unwrap_or_else ( | e | warn ! ( " " e ) ) ; } Err ( e ) => { warn ! ( " " e ) ; } } } } }
Handle a read event (EPOLLIN) on the serial input fd.
Handle a read event ( EPOLLIN ) on the serial input fd .
&mut self
event
&mut EventManager