Returns a new [Buffer] that is a slice of this buffer starting at `offset`. This function is `O(1)` and does not copy any data, allowing the same memory region to be shared between buffers. # Panics Panics iff `offset` is larger than `len`.
(&self, offset: usize)
| 250 | /// |
| 251 | /// Panics iff `offset` is larger than `len`. |
| 252 | pub fn slice(&self, offset: usize) -> Self { |
| 253 | let mut s = self.clone(); |
| 254 | s.advance(offset); |
| 255 | s |
| 256 | } |
| 257 | |
| 258 | /// Increases the offset of this buffer by `offset` |
| 259 | /// |