/// If the associated reader is still open, we read bytes from said reader
/// and mutate the underlying buffer acording to some function. Returns
/// `None` iff `self.rd == None`.
If the associated reader is still open, we read bytes from said reader
and mutate the underlying buffer acording to some function. Returns
`None` iff `self.rd == None`.
If the associated reader is still open we read bytes from said reader and mutate the underlying buffer acording to some function . Returns ` None ` iff ` self . rd == None ` .
pub fn process_read_event<F, R>(&mut self, f: F) -> Option<R>
    where
        F: Fn(&[u8], &mut Buffer) -> R,
    {
        if let Some(ref mut innr) = self.rd {
            let mut avail = Vec::new();
            if let Ok(_n) = innr.read_available(&mut avail) {
                if innr.is_eof() {
                    self.close();
                }
                Some(f(&avail, &mut self.buf))
            } else {
                None
            }
        } else {
            None
        }
    }
pub fn process_read_event < F , R > ( & mut self , f : F ) -> Option < R > where F : Fn ( & [ u8 ] , & mut Buffer ) -> R , { if let Some ( ref mut innr ) = self . rd { let mut avail = Vec :: new ( ) ; if let Ok ( _n ) = innr . read_available ( & mut avail ) { if innr . is_eof ( ) { self . close ( ) ; } Some ( f ( & avail , & mut self . buf ) ) } else { None } } else { None } }
If the associated reader is still open, we read bytes from said reader
and mutate the underlying buffer acording to some function.
If the associated reader is still open we read bytes from said reader and mutate the underlying buffer acording to some function .
&mut self
f
F