/// Reads lines from the given input source and feeds them into the provided
/// sender as [ChildEvent::Line]s.
Reads lines from the given input source and feeds them into the provided
sender as [ChildEvent::Line]s.
Reads lines from the given input source and feeds them into the provided sender as [ ChildEvent :: Line ] s .
pub fn perform_read<E: From<Event>>(
        &mut self,
        log: &Logger,
        src: InputSource,
        snd: &Sender<E>,
    ) {
        let pid = self.pid;
        let f = extend_and_send_lines_through(log, snd, move |line| str2e(pid, src, line));
        let read_res = match src {
            InputSource::Stdout => self.stdout.process_read_event(f),
            InputSource::Stderr => self.stderr.process_read_event(f),
            InputSource::Auxsrc(n) => {
                if let Some(ref mut aux) = self.auxsrc.get_mut(n) {
                    aux.process_read_event(f)
                } else {
                    error!(
                        log,
                        "No available auxsrc({}) to read from; this should not happen", n
                    );
                    None
                }
            }
        };
        // read_res should always be Some(()); this is because we only call
        // Child::perform_read when our mio::poll tells us there is something to
        // read; hence, process_read_event must return `Some` because there is a
        // Read'er to read from.
        if read_res.is_none() {
            warn!(log, "process_read_event returned None");
        }
    }
pub fn perform_read < E : From < Event > > ( & mut self , log : & Logger , src : InputSource , snd : & Sender < E > , ) { let pid = self . pid ; let f = extend_and_send_lines_through ( log , snd , move | line | str2e ( pid , src , line ) ) ; let read_res = match src { InputSource :: Stdout => self . stdout . process_read_event ( f ) , InputSource :: Stderr => self . stderr . process_read_event ( f ) , InputSource :: Auxsrc ( n ) => { if let Some ( ref mut aux ) = self . auxsrc . get_mut ( n ) { aux . process_read_event ( f ) } else { error ! ( log " " n ) ; None } } } ; // read_res should always be Some(()); this is because we only call // Child::perform_read when our mio::poll tells us there is something to // read; hence, process_read_event must return `Some` because there is a // Read'er to read from. if read_res . is_none ( ) { warn ! ( log " " ) ; } }
Reads lines from the given input source and feeds them into the provided
sender as [ChildEvent::Line]s.
Reads lines from the given input source and feeds them into the provided sender as [ ChildEvent :: Line ] s .
&mut self
log
&Logger
src
InputSource
snd
&Sender<E>