pub fn consume(&mut self, count: usize) -> usize {
    let cnt        = cmp::min(count, self.available_data());
    self.position += cnt;
    if self.position > self.capacity / 2 {
      //trace!("consume shift: pos {}, end {}", self.position, self.end);
      self.shift();
    }
    cnt
  }
/// advances the position tracker
///
/// if the position gets past the buffer's half,
/// this will call `shift()` to move the remaining data
/// to the beginning of the buffer
advances the position tracker
if the position gets past the buffer's half,
this will call `shift()` to move the remaining data
to the beginning of the buffer
advances the position tracker if the position gets past the buffer ' s half this will call ` shift () ` to move the remaining data to the beginning of the buffer
pub fn consume(&mut self, count: usize) -> usize {
    let cnt        = cmp::min(count, self.available_data());
    self.position += cnt;
    if self.position > self.capacity / 2 {
      //trace!("consume shift: pos {}, end {}", self.position, self.end);
      self.shift();
    }
    cnt
  }
pub fn consume ( & mut self , count : usize ) -> usize { let cnt = cmp :: min ( count , self . available_data ( ) ) ; self . position += cnt ; if self . position > self . capacity / 2 { //trace!("consume shift: pos {}, end {}", self.position, self.end); self . shift ( ) ; } cnt }
advances the position tracker
if the position gets past the buffer's half,
this will call `shift()` to move the remaining data
to the beginning of the buffer
advances the position tracker if the position gets past the buffer ' s half this will call ` shift () ` to move the remaining data to the beginning of the buffer
&mut self
count
usize
&mut self
count
usize