pub fn clear(&mut self) {
        if self.consumed < self.buf.len() {
            self.buf = self.buf[self.consumed..].to_vec();
        } else {
            self.buf = Vec::new();
        }
        self.consumed = 0;
    }
/// Clears all memory of past reads, shrinking or freeing the buffer in the
/// process. The reader will behave as if freshly constructed, save for
/// already prefetched data, so that no bytes are lost. The following byte
/// being read becomes the byte at index `#0`.
Clears all memory of past reads, shrinking or freeing the buffer in the
process. The reader will behave as if freshly constructed, save for
already prefetched data, so that no bytes are lost. The following byte
being read becomes the byte at index `#0`.
Clears all memory of past reads shrinking or freeing the buffer in the process . The reader will behave as if freshly constructed save for already prefetched data so that no bytes are lost . The following byte being read becomes the byte at index ` #0 ` .
pub fn clear(&mut self) {
        if self.consumed < self.buf.len() {
            self.buf = self.buf[self.consumed..].to_vec();
        } else {
            self.buf = Vec::new();
        }
        self.consumed = 0;
    }
pub fn clear ( & mut self ) { if self . consumed < self . buf . len ( ) { self . buf = self . buf [ self . consumed .. ] . to_vec ( ) ; } else { self . buf = Vec :: new ( ) ; } self . consumed = 0 ; }
Clears all memory of past reads, shrinking or freeing the buffer in the
process.
Clears all memory of past reads shrinking or freeing the buffer in the process .
&mut self
&mut self