pub fn protected_read(&mut self, file: &mut StdinLock) -> usize {
        match file.read(&mut self.v[self.end..]) {
            Err(_) => {
                self.state = StdinProducerState::Error;
                0
            }
            Ok(n) => {
                self.end += n;
                if n == 0 {
                    self.state = StdinProducerState::Eof;
                }
                n
            }
        }
    }
/// Read into the buffer but handle errors using state rather than Result
Read into the buffer but handle errors using state rather than Result
Read into the buffer but handle errors using state rather than Result
pub fn protected_read(&mut self, file: &mut StdinLock) -> usize {
        match file.read(&mut self.v[self.end..]) {
            Err(_) => {
                self.state = StdinProducerState::Error;
                0
            }
            Ok(n) => {
                self.end += n;
                if n == 0 {
                    self.state = StdinProducerState::Eof;
                }
                n
            }
        }
    }
pub fn protected_read ( & mut self , file : & mut StdinLock ) -> usize { match file . read ( & mut self . v [ self . end .. ] ) { Err ( _ ) => { self . state = StdinProducerState :: Error ; 0 } Ok ( n ) => { self . end += n ; if n == 0 { self . state = StdinProducerState :: Eof ; } n } } }
Read into the buffer but handle errors using state rather than Result
Read into the buffer but handle errors using state rather than Result
&mut self
file
&mut StdinLock
&mut self
file
&mut StdinLock