pub fn fill(&mut self, count: usize) -> usize {
    let cnt   = cmp::min(count, self.available_space());
    self.end += cnt;
    if self.available_space() < self.available_data() + cnt {
      //trace!("fill shift: pos {}, end {}", self.position, self.end);
      self.shift();
    }

    cnt
  }
/// after having written data to the buffer, use this function
/// to indicate how many bytes were written
///
/// if there is not enough available space, this function can call
/// `shift()` to move the remaining data to the beginning of the
/// buffer
after having written data to the buffer, use this function
to indicate how many bytes were written

if there is not enough available space, this function can call
`shift()` to move the remaining data to the beginning of the
buffer
after having written data to the buffer use this function to indicate how many bytes were written if there is not enough available space this function can call ` shift () ` to move the remaining data to the beginning of the buffer
pub fn fill(&mut self, count: usize) -> usize {
    let cnt   = cmp::min(count, self.available_space());
    self.end += cnt;
    if self.available_space() < self.available_data() + cnt {
      //trace!("fill shift: pos {}, end {}", self.position, self.end);
      self.shift();
    }
    cnt
  }
pub fn fill ( & mut self , count : usize ) -> usize { let cnt = cmp :: min ( count , self . available_space ( ) ) ; self . end += cnt ; if self . available_space ( ) < self . available_data ( ) + cnt { //trace!("fill shift: pos {}, end {}", self.position, self.end); self . shift ( ) ; } cnt }
after having written data to the buffer, use this function
to indicate how many bytes were written
after having written data to the buffer use this function to indicate how many bytes were written
&mut self
count
usize
&mut self
count
usize