/// After decoding a packet, overwrite the used bytes by shifting the buffer
/// by its length. Assumes the length fits within the buffer's capacity.
After decoding a packet, overwrite the used bytes by shifting the buffer
by its length. Assumes the length fits within the buffer's capacity.
After decoding a packet overwrite the used bytes by shifting the buffer by its length . Assumes the length fits within the buffer ' s capacity .
fn rotate(&mut self, length: usize) {
        self.buffer.copy_within(length.., 0);
        self.range.end -= length;
        self.buffer.truncate(self.buffer.capacity() - length);
        self.buffer
            .resize(self.buffer.capacity(), 0)
            .unwrap_or_else(|()| unreachable!("Length equals to the current capacity."));
    }
fn rotate ( & mut self , length : usize ) { self . buffer . copy_within ( length .. , 0 ) ; self . range . end -= length ; self . buffer . truncate ( self . buffer . capacity ( ) - length ) ; self . buffer . resize ( self . buffer . capacity ( ) , 0 ) . unwrap_or_else ( | ( ) | unreachable ! ( " " ) ) ; }
After decoding a packet, overwrite the used bytes by shifting the buffer
by its length.
After decoding a packet overwrite the used bytes by shifting the buffer by its length .
&mut self
length
usize